From: <leg...@at...> - 2003-09-27 20:58:19
|
The following comment has been added to this issue: Author: Chris Nokleberg Created: Sat, 27 Sep 2003 3:58 PM Body: FYI here is Gavin's comment on this issue: http://www.mail-archive.com/hib...@li.../msg00041.html > I guess, we *could* implement ThreadLocalSession internally in > Hibernate so that proxies and lazy collections _automatically_ pick up > a reference to the current Session. But I've so far resisted this > design. It doesn't work too well for collections, since they can't be > reassociated with a new Session without their current owner also being > reassociated. And there is no way to implement a backpointer from the > collection to its owner. I'm interested in more detail regarding the collection problem. I have some ideas but need more information... --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-368 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-368 Summary: Allow proxies to load in session other than one that created them Type: Improvement Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 Assignee: Reporter: Chris Nokleberg Created: Sat, 27 Sep 2003 3:20 PM Updated: Sat, 27 Sep 2003 3:42 PM Description: For discussion, please see the following forum topic: http://forum.hibernate.org/viewtopic.php?t=42 In summary, there are scenarios in which it one may want proxies to be resolved in a different session. The attached patch adds a ThreadLocal to SessionFactoryImpl which keeps track of the last opened session. If a the session that created a proxy is closed when it comes time to initialize the proxy, the last opened session is used instead, unless it has been closed as well. --------------------------------------------------------------------- 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 |