Atomikos Forum

Hibernate flushing sessions (atomikos vs standard J2ee Tr. mngR)

Hi,

I'm using Atomikos for development profile then swithcing for J2EE container transaction manager in deployed mode. (using glassfish TM for exemple).

I'm using Spring, JPA and Hibernate .

After making some investigations I've notice a difference between Atomikos and Glassfish transaction manager:

  Glassfish flushes the session before closing it. This behavior comes from Hibernate who registers Synchronization point (implementing beforeCompletion() & afterCompletion() ).

  Concerning Atomikos, we have a different behavior here: the session is not fulshed. This is because Hibernate, when trying to register synchronization, doesn't detect Atomikos'transaction as being a --JoinableCMTTransaction--.

AbstractEntityManagerImpl
    line 461:

    if ( transaction != null && transaction instanceof JoinableCMTTransaction ) {
        ... then registers the synchronization ...

I'm using Hibernate 3.3.2.

Considering this difference  we have to take care of flushing ourselves the entity manager after doing a merge for exemple.

>> Guy, do you plan to do any change on the 3.8 release of Atomikos on that point ?
If yes, it is a big change in terms of behavior, Atomikos will work more like most of J2EE transaction managers.

Thank you again for your work.

David
David Renoux Send private email
Monday, July 04, 2011
 
 
Hi

Please check http://www.atomikos.com/Documentation/HibernateIntegration#With_JPA - if you have any suggestions besides this then we'll be glad to take those into consideration.

HTH
Guy Pardon Send private email
Friday, July 08, 2011
 
 
I'm using Hibernate-3.6 with Spring-3 and Atomikos-3.7 and have no problems.

This log-output indicates that things the JoinableCMTTransactionFactory is correctly recognized:


10:49:05,928 INFO  - TransactionFactoryFactory      - Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory

Sample-application here:
https://www.assembla.com/spaces/liftweb/wiki/JPA_AJAX_303_field-validation_Spring_JTA_XA

--
Andreas
Andreas Joseph Krogh Send private email
Friday, August 19, 2011
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics