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 |
From: <leg...@at...> - 2003-08-09 01:45:14
|
The following comment has been added to this issue: Author: Gavin King Created: Fri, 8 Aug 2003 8:43 PM Body: OK, interesting. This is a problem affecting the combination of <key-many-to-one> and <jcs-cache>. The problem is that EntityType.disassemble() just returnins the id (it doesn't try to disassemble the id). I think its easy to fix by just changing EntityType.diassemble()/assemble(). (I didn't really need the teast case after all; all I needed to know was that you were using a <key-many-to-one>!) Thanks. --------------------------------------------------------------------- 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:59 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 |
From: <leg...@at...> - 2004-01-09 00:27:25
|
The following comment has been added to this issue: Author: Travis Savo Created: Thu, 8 Jan 2004 6:26 PM Body: I'm running 2.1.1 (after having upgraded from 2.1 beta and going through the steps of replacing old jars with new ones), and am still getting this error on a regular basis (I was getting it more on 2.1 beta, so something must have changed because the frequency has gone down). The situtations surrounding it appear to be identical (key many-to-one, JCS cache, resin 2.1.6) Where might I look to see why this is happening? I'm comfortable with running Hibernate from a debug session and putting a break point/watch on things. Included is the relevant portion of the stack trace. 16:02:29,860 ERROR LazyInitializationException:25 - Failed to lazily initialize a collection - no Session net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no Session at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:213) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:69) at net.sf.hibernate.collection.Set.iterator(Set.java:131) at com.caucho.jstl.el.ForEachTag.getIterator(ForEachTag.java:315) at com.caucho.jstl.el.ForEachTag.doStartTag(ForEachTag.java:162) at _product._includes._featured_0media__jsp._jspService(_featured_0media__jsp.java:292) at com.caucho.jsp.JavaPage.service(JavaPage.java:75) at com.caucho.jsp.Page.subservice(Page.java:497) --------------------------------------------------------------------- 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 6:26 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 |
From: <leg...@at...> - 2004-01-09 00:34:26
|
The following comment has been added to this issue: Author: Travis Savo Created: Thu, 8 Jan 2004 6:33 PM Body: My bad, it's a one-to-many relationship. Here's the relevant mapping (with sensitive information changed): <set name="releases" table="DB.DBTableRemoved" lazy="true"> <jcs-cache usage="read-only"/> <key column="N_IFILM_ID"/> <one-to-many class="com.ifilm.persistent.Release"/> </set> Is there anything more I can provide to help troubleshoot this? -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 6:33 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 |
From: <leg...@at...> - 2004-01-09 00:47:25
|
The following comment has been added to this issue: Author: Gavin King Created: Thu, 8 Jan 2004 6:46 PM Body: I would say this has nothing to do with the original bug, and is probably just due to you closing the session before accessing the collection. --------------------------------------------------------------------- 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 6:46 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 |
From: <leg...@at...> - 2004-01-09 02:01:25
|
The following comment has been added to this issue: Author: Travis Savo Created: Thu, 8 Jan 2004 8:00 PM Body: When the session is closed, I get: net.sf.hibernate.HibernateException: Session is currently disconnected Which is quite different than 'No Session', is it not? --------------------------------------------------------------------- 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:00 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 |
From: <leg...@at...> - 2004-01-09 02:08:25
|
The following comment has been added to this issue: Author: Gavin King Created: Thu, 8 Jan 2004 8:07 PM Body: The "no session" case usually occurs if the collection was serialized. --------------------------------------------------------------------- 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:07 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 |
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 |
From: <leg...@at...> - 2004-01-09 03:10:24
|
The following comment has been added to this issue: Author: Gavin King Created: Thu, 8 Jan 2004 9:09 PM Body: >>> So how can I re-associate the object with the present session? Doing something like: session.lock(objectWithCollection, LockMode.NONE); <<< That works. --------------------------------------------------------------------- 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 9:09 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 |
From: <leg...@at...> - 2004-01-13 04:15:49
|
The following comment has been added to this issue: Author: Travis Savo Created: Mon, 12 Jan 2004 10:15 PM Body: I didn't want to comment again unless I was sure it was still a problem... I can verify that this is only a problem when the object in question has been serialilzed and is on a different box that the one it orinigated on. In our model this is very common, because frequently an object will be loaded on one box, put up on JCS remote cache, and loaded on another box (via Hibernate which get's it out of JCS Remote Cache). I've tried reassociating the session with the object, with no luck: session.lock(product, LockMode.NONE); The problem is still consistantly reproducable. I've also tried: ((net.sf.hibernate.collection.Set) product.getReleases()).setCurrentSession((SessionImplementor) session); Which didn't complain, but didn't have any effect either. In these situtations, no amount of session.lock(XXXX, LockMode.NONE) or .setCurrentSession(session) on the lazily loaded collection seems to fix it. I can verify for a fact that the session in question is in fact open and working, both before and after the No Session exception. I suspect the fact that these objects wern't orinigally loaded on this box has some bearing in this senario, but shouldn't reassociating the session with the object containing the lazily loaded collection solve this? Because I can verify that it dosn't. Any assistance in this would be greatly appreaciated. -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 Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown 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: Mon, 12 Jan 2004 10:15 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 |
From: <leg...@at...> - 2004-01-14 19:58:49
|
The following comment has been added to this issue: Author: Gavin King Created: Wed, 14 Jan 2004 1:58 PM Body: I *really* don't believe in this at all. If you can produce a VERY simple main() method that reproduces the problem, I will take a look. --------------------------------------------------------------------- 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 Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown 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: Wed, 14 Jan 2004 1:58 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 |