I have object1 which have collection of object2 which have association with object3.
I add new object2 with transient instance of object3 into object1 collection. Then I save object1. It cascades save to object2. Then I need to reread the object1 state from the database. So I call session.get(Object1.class, object1.getId()); returned object contains newly added object2 in the collection and that object2 has original transient object3, which is not associated with the current session. So I get LazyInitializationException...
I think that session have to check if all returned objects are associated with current session.
Activity
Brett MeyerMarch 3, 2014 at 3:40 PM
Bulk rejecting issues lacking a test case or recent response.
Brett MeyerDecember 19, 2013 at 10:31 PM
Note: In an attempt to clean up the HHH JIRA, we will be rejecting any ticket that sits in the "Awaiting Test Case" state for 2-3 months with no response. So, if this issue is critical to you, please attach a reproducing test case ASAP. Thanks!
Brett MeyerDecember 18, 2013 at 8:54 PM
If this is still an issue on ORM 4.2 or 4.3, anyone have a test case to attach?
I have object1 which have collection of object2 which have association with object3.
I add new object2 with transient instance of object3 into object1 collection. Then I save object1. It cascades save to object2. Then I need to reread the object1 state from the database. So I call session.get(Object1.class, object1.getId()); returned object contains newly added object2 in the collection and that object2 has original transient object3, which is not associated with the current session. So I get LazyInitializationException...
I think that session have to check if all returned objects are associated with current session.