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

Cédric Chantepie (JIRA) noreply at atlassian.com
Thu Sep 29 11:54:28 EDT 2011


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


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