Atomikos Forum

Session not automatically flushed on commit (JPA)

I have a setup with hibernate+JPA+atomikos. I have configured this setup according to the atomikos documentation. However, I found that the session wasn't flushed on completion of a transaction. A manual flush of the JPA EntityManager solves the problem, but this is not something you want to do at all times.

After a long google I found this topic on your forum:

default82df.html?community.6.1085.2#discussTopic1086

And that solved the problem! So, when you don't define your datasource as a jta-datasource in your persistence.xml you have to add the following two items:

<entry key="javax.persistence.transactionType" value="jta"/>
<entry key="hibernate.transaction.factory_class" value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory"/>

I made here a new forum topic because I hope this one googles quicker to the solution. Also, I want to stress that setting "javax.persistence.transactionType" is also crucial, which was not directly mentioned in the original topic. And finally, I would like to invite the atomikos engineers to include this in the standard documentation. Unless, I am missing something of course, but I have tried just about everything and this came up as the only working solution.
Evert De Rammelaere Send private email
Thursday, September 02, 2010
 
 
This is already known. Look at the wiki here and read:

http://www.atomikos.com/Documentation/HibernateIntegration#With_JPA

There you find this link:

http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/transactions.html#transactions-demarcation-jta

So its already documented. Reading the forums there is already a thread about this here:

default82df.html?community.6.1436.11
Torsten Krah Send private email
Monday, September 27, 2010
 
 
Well, I didn't find the exact configuration I described in any of the links you propose here. So I think my post is justified and one might think about adding it to the wiki.
Evert De Rammelaere Send private email
Tuesday, September 28, 2010
 
 

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

Other recent topics Other recent topics