[hibernate-issues] [Hibernate-JIRA] Commented: (JPA-23) Isolation concurrency between persistence context

Cédric Chantepie (JIRA) noreply at atlassian.com
Fri Sep 30 08:57:20 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/JPA-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43931#comment-43931 ] 

Cédric Chantepie commented on JPA-23:
-------------------------------------

It seems that there was a test synchronization trouble : test does not wait for confirmation.

But I still think there is something about isolation, if test does not wait it value must not be found in either table A or table B (as commit hasn't occured). From my point of view it's as if test read 'partially' committed data.

> Isolation concurrency between persistence context
> -------------------------------------------------
>
>                 Key: JPA-23
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-23
>             Project: Java Persistence API
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>         Environment: JBoss 5.1.0.GA / sun jdk 1.6 / PostgreSQL 8.x / Hibernate EntityManager 3.4
>            Reporter: Cédric Chantepie
>              Labels: concurrency, ejb3, flush, isolation, jboss, mdb, transaction
>
> I have an EJB3 MDB deployed in JBoss (container transaction, transaction Required for onMessage), this MDB uses injected EntityManager (JTA one injected with @PersistenceContext type=Transaction in MDB) in order to update a same value as property for 2 differents entities (mapped on 2 differents tables in PostgreSQL database).
> If I check by hand in database (with psql client), everything is coherent as the value is the same in the 2 involved tables.
> I also trigger MDB from a standalone JUnit TestCase (runned by maven). In order to be aware in this test that MDB transaction is successfully commited, I register a Synchronisation instance in MDB, and in afterCompletion method I send back to the JMS confirmation message (as TestCase is also a MessageListener to be notified).
> In this case, TestCase is properly notified that MDB work is completed, but when it try to check value using its own EntityManager (as TestCase is outside JBoss), sometimes (not always unluckily) this value is ok in one table/entity but not in the other.
> I've tried various hibernate settings (isolation level, hibernate.transaction.factory_class, hibernate.transaction.manager_lookup_class), but trouble still occurs.
> EntityManager used by TestCase is a RESOURCE_LOCAL one.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list