﻿<?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>Diego Mijelshon commented on A bug that drove me crazy!</title><description>Two variations on what others said: if the session is like NH's, Load might never return null OR it might never go to the database twice for the same ID in the same session, so the session should be opened INSIDE the loop.
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment15</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment15</guid><pubDate>Tue, 25 May 2010 16:32:03 GMT</pubDate></item><item><title>Bogdan Marian commented on A bug that drove me crazy!</title><description> I know that NHibernate session does not sync its content with the DB unless you either commit the transaction or call its Flush method. I do not know if a RavenDB session acts in a similar way, but if it does, I see no transaction commit or flush, so your company was not deleted yet ...
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment14</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment14</guid><pubDate>Tue, 25 May 2010 12:33:51 GMT</pubDate></item><item><title>kamil commented on A bug that drove me crazy!</title><description>What about transactions?
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment13</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment13</guid><pubDate>Tue, 25 May 2010 11:06:18 GMT</pubDate></item><item><title>Dhananjay Goyani commented on A bug that drove me crazy!</title><description>+1 for Mistertom, Steve Py and  Markus Zywitza. ;-)
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment12</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment12</guid><pubDate>Tue, 25 May 2010 05:38:59 GMT</pubDate></item><item><title>Mistertom commented on A bug that drove me crazy!</title><description>I think the session should be opened inside the for loop.
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment11</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment11</guid><pubDate>Mon, 24 May 2010 21:51:57 GMT</pubDate></item><item><title>Kristian Erbou commented on A bug that drove me crazy!</title><description>If there is a Flushmode enumeration in the Raven Client API (similar to NHibernate) my answer would be that Flushmode is set to Never on the sessions you get back from your session factory.
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment10</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment10</guid><pubDate>Mon, 24 May 2010 18:46:35 GMT</pubDate></item><item><title>Benny Thomas commented on A bug that drove me crazy!</title><description>Damn, my answer came to fast, truly newbie...
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment9</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment9</guid><pubDate>Mon, 24 May 2010 13:10:58 GMT</pubDate></item><item><title>Bernhard commented on A bug that drove me crazy!</title><description>I'd like to jump in and say that it appears your test is missing a pre-condition.
  
  
I think you should ensure "companies/1" exists in store1 and store2 before you delete it from store1, and poll store2 until timeout or it no longer exists.
  
  
I'm not aware of the specific syntax for RavenDB [yet] but I am surprised that there is no query you can use to see if "companies/1" exists other than to load the company.
  
  
I assume RavenDB will return null if the requested document is not found?
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment8</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment8</guid><pubDate>Mon, 24 May 2010 12:33:06 GMT</pubDate></item><item><title>Glenn commented on A bug that drove me crazy!</title><description>Yeah, I was thinking cache too. 
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment7</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment7</guid><pubDate>Mon, 24 May 2010 11:53:10 GMT</pubDate></item><item><title>Rob Ashton commented on A bug that drove me crazy!</title><description>But that's only because you hinted about it being about the session, I'd not have seen that - and I'm fairly sure I've done similar in NH before by accident!
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment6</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment6</guid><pubDate>Mon, 24 May 2010 11:25:43 GMT</pubDate></item><item><title>Rob Ashton commented on A bug that drove me crazy!</title><description>Caching is the answer from my glance
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment5</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment5</guid><pubDate>Mon, 24 May 2010 11:24:42 GMT</pubDate></item><item><title>Steve Py commented on A bug that drove me crazy!</title><description>My guess would be along the lines of Rafal..
  
  
I don't know RavenDB but I'd guess there'd be a parameter available on Load() to ensure a clean hit to the document source. (I.e. NoCache)
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment4</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment4</guid><pubDate>Mon, 24 May 2010 11:06:07 GMT</pubDate></item><item><title>Benny Thomas commented on A bug that drove me crazy!</title><description>if (company == null) is the bug
  
  
if (company != null) is the correct thing you want to do.
  
  
Those thing are can drive one crazy
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment3</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment3</guid><pubDate>Mon, 24 May 2010 10:46:25 GMT</pubDate></item><item><title>Markus Zywitza commented on A bug that drove me crazy!</title><description>If loaded once successfully, the non-null object is cached by the session.
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment2</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment2</guid><pubDate>Mon, 24 May 2010 10:23:15 GMT</pubDate></item><item><title>Rafal commented on A bug that drove me crazy!</title><description>A session-level cache doesn't know that underlying data was deleted after it has been read for the first time?
</description><link>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment1</link><guid>http://ayende.com/4518/a-bug-that-drove-me-crazy#comment1</guid><pubDate>Mon, 24 May 2010 09:02:06 GMT</pubDate></item></channel></rss>