if it already fails in 2.0, i would vote to keep it that way... it's indeed
faulty user code, and the sooner the user knows about it, the better (IMHO)

On Thu, Feb 12, 2009 at 8:09 AM, Ayende Rahien <[email protected]> wrote:

> What should the following code do?
> using (var session1 = sessions.OpenSession())
> using (var tx1 = session1.BeginTransaction())
> {
>
>     using (var session2 = sessions.OpenSession())
>     using (var tx2 = session2.BeginTransaction())
>     {
>         var employee = session2.Load<Employee>(1);
>         Assert.IsFalse(session1.Contains(employee));
>         Assert.IsTrue(session2.Contains(employee));
>
>         session1.Evict(employee);
>
>         Assert.IsFalse(session1.Contains(employee));
>
>         Assert.IsTrue(session2.Contains(employee));
>
>         tx2.Commit();
>     }
>
>     tx1.Commit();
> }
>
> In 1.2 & 2.1, it pass.
> In 2.0, it fails with KeyNotFoundException
>
> To me, this is a bug in the user code.
> The question is, should we try to warn about this? Or should we ignore it?
>



-- 
Davy Brion
http://davybrion.com

Reply via email to