-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Done
-
Affects Version/s: EAP 5.0.0, EAP 5.0.1
-
Fix Version/s: EAP_EWP 5.1.0
-
Component/s: Hibernate
-
Labels:None
-
Environment:
EAP 5.0.0 with the included Hibernate
-
Affects:Release Notes
-
Workaround:Workaround Exists
-
Workaround Description:
Is related to: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3220
==========
When performing a query in a stateless session, the query loads objects in a two-phase process in which a temporary persistence context is populated with empty objects in the first phase, then the objects' member data are read from the database in the second phase. If one of the objects contains an association or a collection, it performs a recursive call to the session's get() method. The get() method clears the temporary persistence context, so if the parent object contains any other associations to be read in the second phase, Hibernate throws an assertion because they are not found in the persistence context.
This patch solves the problem by only clearing the persistence context when the recursion ends. It passes all the unit tests for our application, but I have not tested it with any of the Hibernate unit tests.
==========