From: <leg...@at...> - 2003-08-08 23:52:14
|
The following comment has been added to this issue: Author: John Kristian Created: Fri, 8 Aug 2003 6:51 PM Body: I first reported this issue in <http://sourceforge.net/forum/forum.php?thread_id=911047&forum_id=128638>. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-241 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-241 Summary: cached collection depends on closed Session Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0.1 Assignee: Reporter: John Kristian Created: Fri, 8 Aug 2003 6:48 PM Updated: Fri, 8 Aug 2003 6:48 PM Environment: Windows XP, JBoss 3, Microsoft SQL Server Description: There's a problem with a collection in the JCS cache that contains entities whose composite-id contains a reference to an entity that contains a lazy collection. An exception 'Failed to lazily initialize a collection - no Session' is thrown when attempting to initialize a lazy collection member of an entity referred to by the composite-id of an entity contained in a collection from the JCS cache, if the cached collection was loaded (and cached) by a Session that is now closed. An exception should not be thrown, in this case. The lazy collection should be initialized using the Session that found the cached collection. It appears (although I'm not entirely certain) that composite-ids from the cached collection contain references to entities that were loaded by a previous Session (that missed the JCS cache) which is now closed. This seems erroneous, to me; I think such a composite-id should contain references to entities in the current Session (that hit the JCS cache). To work around this problem, I intend to make the setId method of my entities check the references (if any) in the new id and replace them, if necessary, with references to objects with the same id but in the same Session as the containing entity. Critique and better ideas are welcome <mailto:jkr...@do...>. I have a tolerably small test case, which I'll attach to this issue if I can figure out how. (I'm not familiar with JIRA.) --------------------------------------------------------------------- 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 |