I try to use JPA and JTA on JBoss 4.0.4 GA.
When the persistent unit is configured to use org.hibernate.transaction.JTATransactionFactory, I got a warning message say that "[org.hibernate.ejb.AbstractEntityManagerImpl] Cannot join transaction, not a JoinableCMTTransaction". The data can not be inserted into the database.
So I change to use JoinableCMTTransactionFactory as the value of hibernate.transaction.factory_class property. I got another warning message "[org.hibernate.ejb.Ejb3Configuration] Overriding hibernate.transaction.factory_class is dangerous, this might break the EJB3 specification implementation", but this time the data in the database can be inserted or updated.
Does someone kindly tell me if the above usage of JoinableCMTTransactionFactory is appropriate?
Thanks.
the following is the content of persistent xml file
Code:
<persistence-unit name="conf-jta" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jtaDataSource</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-update"/>
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="true" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>