From: Steve E. (JIRA) <no...@at...> - 2006-05-02 18:53:28
|
Session.get() behavior ---------------------- Key: HHH-1714 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 Project: Hibernate3 Type: Bug Components: core Reporter: Steve Ebersole Assigned to: Steve Ebersole Fix For: 3.2.1 The behavior of Session.get() should be as follows: 1) if the entity to get is already associated with the session: a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) b) as a naked entity, return that entity 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Steve E. (JIRA) <no...@at...> - 2006-05-02 19:01:29
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=all ] Steve Ebersole resolved HHH-1714: --------------------------------- Resolution: Fixed > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Max R. A. (JIRA) <no...@at...> - 2006-05-03 08:17:25
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22962 ] Max Rydahl Andersen commented on HHH-1714: ------------------------------------------ Session.get should not result in ONFE, it should return null. That's the whole point, right ? and we can't just try and swallow the exception, we need to do a check that will not cause ONFE. > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Emmanuel B. (JIRA) <no...@at...> - 2006-05-03 12:30:28
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22963 ] Emmanuel Bernard commented on HHH-1714: --------------------------------------- no we discuss that and returning null actually is inconsistent esp regarding association fetching. So we raise an exception. What was clearly wrong is, returning the proxy and no exception > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Max R. A. (JIRA) <no...@at...> - 2006-05-03 12:37:28
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22964 ] Max Rydahl Andersen commented on HHH-1714: ------------------------------------------ Sure that was clearly wrong, but: 1) ejb3 spec states return null; 2) we previously had jira's on ONFE being thrown by get which then were fixed not to do it (AFAIK) 3) this is a braeking change. > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Max R. A. (JIRA) <no...@at...> - 2006-05-03 12:39:24
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22965 ] Max Rydahl Andersen commented on HHH-1714: ------------------------------------------ 4) what is the usage of get() when we have load and query. > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Steve E. (JIRA) <no...@at...> - 2006-05-03 14:01:34
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22966 ] Steve Ebersole commented on HHH-1714: ------------------------------------- I don't get what is so difficult to grasp about this. In what you suggest, get() and load() are no longer symetric; load() will return some proxy while get() on the same "entity" will return null. How is that "good" again? > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Max R. A. (JIRA) <no...@at...> - 2006-05-03 14:55:26
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22970 ] Max Rydahl Andersen commented on HHH-1714: ------------------------------------------ I know the reasoning for doing it like this, but what is the usage of get() then ? Just a way to guarantee a db hit when referencing something ? :) > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Steve E. (JIRA) <no...@at...> - 2006-05-03 15:01:27
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22971 ] Steve Ebersole commented on HHH-1714: ------------------------------------- The same as it has always (supposed to have) been: you get back either: (1) null (2) a "naked" entity or initialized proxy > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Steve E. (JIRA) <no...@at...> - 2006-05-03 15:03:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22972 ] Steve Ebersole commented on HHH-1714: ------------------------------------- And no, it does not always necessitate a db hit... > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Max R. A. (JIRA) <no...@at...> - 2006-05-03 16:45:26
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_22973 ] Max Rydahl Andersen commented on HHH-1714: ------------------------------------------ yeah I know it wont *always* do a hit, but now I just don't see the big need for having the operation in the first place. so now we just need to update the javadoc + the ejb3 spec to reflect this possible exception (at least to be friendly to the users ;) > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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: Lars T. (JIRA) <no...@at...> - 2006-05-10 05:34:24
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714?page=comments#action_23058 ] Lars Torunski commented on HHH-1714: ------------------------------------ Steve, 3.2.0 isn't released yet, but this issue is fixed in 3.2.1? > Session.get() behavior > ---------------------- > > Key: HHH-1714 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1714 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Fix For: 3.2.1 > > > The behavior of Session.get() should be as follows: > 1) if the entity to get is already associated with the session: > a) as a proxy, return the proxy making sure it gets initialized (potentially resulting in a ONFE) > b) as a naked entity, return that entity > 2) if the entity to get is not already associated with the session, attempt to load it either returning null if not found or the "naked" loaded entity > Currently (1.a) is messed up in that the proxy is returned but not forced to initialize -- 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 |