﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>evereq commented on Where is the bug?</title><description>ha ha ha :D Nice that such things happens not only with me :D
  
  
P.S.  I was think that WaitForNonStaleResults should actually do promote changes in context into database for given index... i.e. it's little bit confusing to wait for index to updated in storage with fact that you still have some documents in memory that not yet added to index......
</description><link>http://ayende.com/4588/where-is-the-bug#comment15</link><guid>http://ayende.com/4588/where-is-the-bug#comment15</guid><pubDate>Mon, 16 Aug 2010 10:17:03 GMT</pubDate></item><item><title>Ayende Rahien commented on Where is the bug?</title><description>evereq,
  
Actually, the bug is that there is no SaveChanges, so stuff doesn't get to the server, and doesn't get saved.
  
The reason it took me so long to figure it out was that I simply didn't notice that SaveChanges was missing
</description><link>http://ayende.com/4588/where-is-the-bug#comment14</link><guid>http://ayende.com/4588/where-is-the-bug#comment14</guid><pubDate>Mon, 16 Aug 2010 08:50:37 GMT</pubDate></item><item><title>evereq commented on Where is the bug?</title><description>@Alwin, @Thomas Freudenberg  etc - I think its not necessary to call session.SaveChanges() due to usage of WaitForNonStaleResults, or?
  
  
My another attempt: maybe you forgot to do initialization (i.e. say documentStore.Initialize();)  in NewDocumentStore() method that you forgot to show here as well :D
  
  
But still I feel that something wrong with Where(...) and decimal values like from my previous comment :)
  
  
Common, Ayende, let us know issue that you spend 2 hours :)
  
I assume that if you spend 2 hours debugging it, it's simply not so easy to found such bug in just few minutes that most of us have :D
</description><link>http://ayende.com/4588/where-is-the-bug#comment13</link><guid>http://ayende.com/4588/where-is-the-bug#comment13</guid><pubDate>Mon, 16 Aug 2010 08:38:08 GMT</pubDate></item><item><title>Alwin commented on Where is the bug?</title><description>The session.Store() does nothing until the session ends. So session.Query() will never find anything because it is not stored yet.
  
  
Wrapping session.Store() in its own session, and 2x session.Quer() in another will pass the test.
  
  
Or does calling session.Query() flush first?
</description><link>http://ayende.com/4588/where-is-the-bug#comment12</link><guid>http://ayende.com/4588/where-is-the-bug#comment12</guid><pubDate>Mon, 16 Aug 2010 01:42:32 GMT</pubDate></item><item><title>Steve Py commented on Where is the bug?</title><description>Hmm, there's nothing wrong with the comparison &amp; data types, unless there's something odd with the unit test framework you're using. (I've verified the behaviour of the data type comparisons with NUnit.)
  
  
I don't know much about RavenDB but my guess would be that you haven't told it to retrieve the data, there is no Select or SelectFields, so would the Linq2Object .Where() condition have anything to search through?
</description><link>http://ayende.com/4588/where-is-the-bug#comment11</link><guid>http://ayende.com/4588/where-is-the-bug#comment11</guid><pubDate>Mon, 16 Aug 2010 01:34:44 GMT</pubDate></item><item><title>Imran commented on Where is the bug?</title><description>Either decimal will accurately represent 1.33 and so your 1.331 comparison will fail, or you need to use a tolerance value for comparison, like absolute value of val - 1.33 &gt; 0.01?
</description><link>http://ayende.com/4588/where-is-the-bug#comment10</link><guid>http://ayende.com/4588/where-is-the-bug#comment10</guid><pubDate>Sun, 15 Aug 2010 06:44:42 GMT</pubDate></item><item><title>fschwiet commented on Where is the bug?</title><description>Needs more round trips to the server
</description><link>http://ayende.com/4588/where-is-the-bug#comment9</link><guid>http://ayende.com/4588/where-is-the-bug#comment9</guid><pubDate>Sun, 15 Aug 2010 04:14:37 GMT</pubDate></item><item><title>Kristian Erbou commented on Where is the bug?</title><description>You set up your test using float and decimal. I remember from somewhere (maybe the first time I've actually put an MS certification into use) that float is stored as binary and should not be used in situations where you need to verify equality on large numbers.
</description><link>http://ayende.com/4588/where-is-the-bug#comment8</link><guid>http://ayende.com/4588/where-is-the-bug#comment8</guid><pubDate>Sat, 14 Aug 2010 18:48:54 GMT</pubDate></item><item><title>evereq commented on Where is the bug?</title><description>I don't have 2 hours, sorry,  but maybe something wrong with Range indexing for decimal values (i.e. in your Where (x=&gt; x.M ...) )? Cast or something? As far as I remember Db create 2 indexes, maybe it use wrong one and you get not correct result? ;-)
</description><link>http://ayende.com/4588/where-is-the-bug#comment7</link><guid>http://ayende.com/4588/where-is-the-bug#comment7</guid><pubDate>Sat, 14 Aug 2010 15:08:11 GMT</pubDate></item><item><title>Thomas Freudenberg commented on Where is the bug?</title><description>@configurator: the first line in the tests creates a fresh db
</description><link>http://ayende.com/4588/where-is-the-bug#comment6</link><guid>http://ayende.com/4588/where-is-the-bug#comment6</guid><pubDate>Sat, 14 Aug 2010 12:56:18 GMT</pubDate></item><item><title>configurator commented on Where is the bug?</title><description>My guess: You already have a value in the DB with a value about 1.331m?
</description><link>http://ayende.com/4588/where-is-the-bug#comment5</link><guid>http://ayende.com/4588/where-is-the-bug#comment5</guid><pubDate>Sat, 14 Aug 2010 12:45:31 GMT</pubDate></item><item><title>Thomas Freudenberg commented on Where is the bug?</title><description>Not calling session.SaveChanges() ?
</description><link>http://ayende.com/4588/where-is-the-bug#comment4</link><guid>http://ayende.com/4588/where-is-the-bug#comment4</guid><pubDate>Sat, 14 Aug 2010 10:10:26 GMT</pubDate></item><item><title>[ICR] commented on Where is the bug?</title><description>&lt; should be &lt;= ?
</description><link>http://ayende.com/4588/where-is-the-bug#comment3</link><guid>http://ayende.com/4588/where-is-the-bug#comment3</guid><pubDate>Sat, 14 Aug 2010 09:53:05 GMT</pubDate></item><item><title>tobi commented on Where is the bug?</title><description>Reflector tells me that you are not using nunit but xunit and that xunit does not do a reference comparison in Assert.Equals which I hat expected.
  
  
Second guess: you have to call SaveChanges.
</description><link>http://ayende.com/4588/where-is-the-bug#comment2</link><guid>http://ayende.com/4588/where-is-the-bug#comment2</guid><pubDate>Sat, 14 Aug 2010 09:42:06 GMT</pubDate></item><item><title>tobi commented on Where is the bug?</title><description>This is my suspicion: 
[stackoverflow.com/.../nunit-assert-equals-what-...](http://stackoverflow.com/questions/1085278/nunit-assert-equals-what-am-i-missing)</description><link>http://ayende.com/4588/where-is-the-bug#comment1</link><guid>http://ayende.com/4588/where-is-the-bug#comment1</guid><pubDate>Sat, 14 Aug 2010 09:24:28 GMT</pubDate></item></channel></rss>