Loading...

nhibernate-development@lists.sourceforge.net

[Prev] Thread [Next]  |  [Prev] Date [Next]

[NHibernate-development] Second level cache with criteria queries Ayende Rahien Thu May 08 06:01:00 2008

Guys,
I must have some form of special blindness here ,because I can't figure out
why this test is failing.
I tracked it down to different timestamps being used. But I can't figure out
why.
Any ideas?

In SecondLevelCacheTest:

[Test]
public void SecondLevelCacheWithCriteriaQueries()
{
    using (ISession session = OpenSession())
    {
        IList list = session.CreateCriteria(typeof (Item))
            .Add(Expression.Gt("Id", 2))
            .SetCacheable(true)
            .List();
        Assert.AreEqual(3, list.Count);

        using(IDbCommand cmd = session.Connection.CreateCommand())
        {
            cmd.CommandText = "DELETE FROM Item";
            cmd.ExecuteNonQuery();
        }
    }

    using(ISession session = OpenSession())
    {
        //should bring from cache
        IList list = session.CreateCriteria(typeof (Item))
            .Add(Expression.Gt("Id", 2))
            .SetCacheable(true)
            .List();
        Assert.AreEqual(3, list.Count);
    }
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nhibernate-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development