Child collections are not being stored in the second level cache

Description

Logging showed that child collections were being loaded from the database with every page hit, although individual entities are successfully stored in the cache. This happens regardless of whether or not the child collections are also being lazy loaded.

Further investigation indicates that NHibernate is looking for child collections in the cache but not saving them.

Environment

Windows XP Pro, .net 1.1, NHibernate 0.6.0.0, NHibernateContrib 0.6.0.0 modified to correct issue NH-194

Activity

Show:

MikeM February 25, 2005 at 4:28 PM

0.7 was released

MikeM February 18, 2005 at 8:33 AM

Hi James, this https://nhibernate.jira.com/browse/NH-160 describes what you've noticed.

Collections are now loaded from cache when there.

Mike

James McKay February 18, 2005 at 8:04 AM

Okay, I've downloaded the latest sources from CVS and it seems to work fine now.

There's one other related issue that I have noticed though. When I try to load a non-existent object using ISession.Get(), a subsequent request for the same object results in another round trip to the database. Would it be worth considering adding some kind of marker object to the cache in this case to flag that the item wasn't found?

MikeM February 6, 2005 at 5:45 PM

Code was committed to cvs - I believe it is fixed there by stepping through it during the test run.

Need to find a better way than stepping through code to verify test is running - look at raising events from cache for hits, misses, etc...

MikeM February 5, 2005 at 11:54 PM

Did alot of digging into how collections are being cached. In the middle of debugging, but it definitely is a problem as described.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created February 3, 2005 at 2:29 AM
Updated February 25, 2005 at 4:28 PM
Resolved February 18, 2005 at 8:33 AM
Who's Looking?