Transient object returned from session

Description

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.

Environment

hibernete 3.1.3, 3.1.2

Activity

Show:
Brett Meyer
December 18, 2013, 8:54 PM

If this is still an issue on ORM 4.2 or 4.3, anyone have a test case to attach?

Brett Meyer
December 19, 2013, 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 Meyer
March 3, 2014, 3:40 PM

Bulk rejecting issues lacking a test case or recent response.

Rejected

Assignee

Unassigned

Reporter

Tomas Drencak

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure