[hibernate-issues] [Hibernate-JIRA] Assigned: (HHH-3220) Patch to prevent "org.hibernate.AssertionFailure: possible non-threadsafe access to the session" error caused by stateless sessions

Strong Liu (JIRA) noreply at atlassian.com
Thu Feb 18 11:27:48 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Strong Liu reassigned HHH-3220:
-------------------------------

    Assignee: Strong Liu

> Patch to prevent "org.hibernate.AssertionFailure: possible non-threadsafe access to the session" error caused by stateless sessions
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-3220
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3220
>             Project: Hibernate Core
>          Issue Type: Patch
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Hibernate 3.2.6, Apache Derby on Mac OSX & PC
>            Reporter: Dan Bisalputra
>            Assignee: Strong Liu
>            Priority: Minor
>         Attachments: HibernateStatelessSessionCriteriaAssertionFailureTest.java, HibernateStatelessSessionCriteriaAssertionFailureTest.java, StatelessSession-patch
>
>
> 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.

-- 
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

        


More information about the hibernate-issues mailing list