From: <leg...@at...> - 2003-12-31 10:15:29
|
The following comment has been added to this issue: Author: Gavin King Created: Wed, 31 Dec 2003 4:14 AM Body: Interesting. This functionality was intended and indeed may have changed since 2.0.x. I'm amazed it takes so long to pull stuff from the cache!? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-587 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-587 Summary: Lazy collections not lazy when used with second level cache Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: Juho Snellman Created: Tue, 30 Dec 2003 8:53 AM Updated: Wed, 31 Dec 2003 4:14 AM Environment: Hibernate 2.1.1 ehcache Description: When an object is loaded from the second level cache, any of its collections that are found from the cache are immediately initialized. This happens for both lazy and non-lazy collections. These initializations then cascade on to the contents of the collection, and their child-collections. For a sufficiently large and interconnected graph of objects this results in a disastrous performance loss when caching is enabled. In my particular case a test enabling caching increases the runtime of a test from about 12 minutes to over 40 minutes. In the latter case SessionImpl.getCachedCollection() takes up 68% of the runtime. Disabling caching only for collections brings the runtime back down. Aside from the performance issue, it seems to me that initializing lazy collections is also conceptually wrong. Shouldn't laziness mean "no work is done unless it's neccessary", instead of "nothing is fetched from the DB unless it's neccessary"? I'm pretty sure this didn't happen with Hibernate 2.0 and JCS. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |