From: <leg...@at...> - 2004-01-09 02:18:25
|
The following comment has been added to this issue: Author: Travis Savo Created: Thu, 8 Jan 2004 8:17 PM Body: Agreed. This only seems to happen when an object has been serialized (to a remote JCS cache for instance... so the session in question may be on an entirely different box). So how can I re-associate the object with the present session? Doing something like: session.lock(objectWithCollection, LockMode.NONE); dosn't seem to fix the problem, because it's not the object we want associated with the session... it's the Set on the object that we want. session.lock(objectWithCollection.getCollection(), LockMode.NONE); dosn't work either: It says there's no persister for a net.sf.hibernate.collection.Set. Suggestions here? I'll jump through flaming hoops to reassociate a session with a collection if I have to, just point me in the right direction if you could. Thanks so much. -Travis Savo <ts...@if...> --------------------------------------------------------------------- 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: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 beta 1 Versions: 2.0.1 Assignee: Reporter: John Kristian Created: Fri, 8 Aug 2003 6:48 PM Updated: Thu, 8 Jan 2004 8:17 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 |