From: <leg...@at...> - 2003-09-27 20:49:20
|
The following comment has been added to this issue: Author: Chris Nokleberg Created: Sat, 27 Sep 2003 3:48 PM Body: This patch does not open a new session to fetch the proxy data, it simply uses the current session if there is already one open. If there is no open session an exception will be thrown just like happens now. The workarounds you suggest are not acceptable for the same reason that it is infeasible to initialize all proxies before sending them to the view layer--they may be contained within an arbitrarily complex object model. I'm happy to help find a workaround for the technical issue of lazy loaded collections (I don't think it is impossible). --------------------------------------------------------------------- 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 |
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 |
From: <leg...@at...> - 2003-09-27 21:04:20
|
The following comment has been added to this issue: Author: Gavin King Created: Sat, 27 Sep 2003 4:03 PM Body: Chris, Max and I are discussing this (in Aarhus). I think we would accept something like this if: (1) it worked by calling Session.lock() (2) it worked for collections (which would require that a collection wrapper keep a pointer back to the owning entity, so that it could lock() the owner) (3) we could turn this feature off --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-09-27 21:06:23
|
The following comment has been added to this issue: Author: Gavin King Created: Sat, 27 Sep 2003 4:04 PM Body: > And there is no way to implement a backpointer from the > collection to its owner. I wonder why I wrote this. I can't quite remember what the problem is. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-09-27 21:08:22
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Sat, 27 Sep 2003 4:06 PM Body: Sitting here with Gavin talking about it right now ;) It is not a totally absurd idea, but it really opens up for some "spookey" error situations. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-09-28 03:54:49
|
The following comment has been added to this issue: Author: Chris Nokleberg Created: Sat, 27 Sep 2003 9:39 PM Body: > It is not a totally absurd idea Thanks ;-) Hope we can find a way to make this work. Chris --------------------------------------------------------------------- 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 |
From: Mike H. (JIRA) <no...@at...> - 2005-09-22 21:47:02
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-368?page=comments#action_19913 ] Mike Hogan commented on HB-368: ------------------------------- Why was this issue rejected? The thread seemed to be going well towards agreement to find an approach, then nothing except "Status: Rejected". I am looking for a feature like this. Maybe implemented by way of a SessionReattachmentPolicy that allows the Hibernate user have some say about what happens when AbstractLazyInitializer does this: else if ( !session.isOpen() ) { throw new LazyInitializationException("could not initialize proxy - the owning Session was closed"); } Can somebody please explain what happened to this issue? Thanks very much. Mike > Allow proxies to load in session other than one that created them > ----------------------------------------------------------------- > > Key: HB-368 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-368 > Project: Hibernate2 > Type: Improvement > Components: core > Versions: 2.1 > Reporter: Chris Nokleberg > Attachments: lazypatch.txt > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Chris N. (JIRA) <no...@at...> - 2005-09-23 00:52:36
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-368?page=comments#action_19916 ] Chris Nokleberg commented on HB-368: ------------------------------------ I stopped writing web applications, so I didn't press the issue. But I would guess that there are still quite a few people who run into problems with uninitialized proxies. > Allow proxies to load in session other than one that created them > ----------------------------------------------------------------- > > Key: HB-368 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-368 > Project: Hibernate2 > Type: Improvement > Components: core > Versions: 2.1 > Reporter: Chris Nokleberg > Attachments: lazypatch.txt > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |