I am facing same problem in Container managed EntityManager with JBoss app server. Getting following lines in log file :
Code:
INFO [org.hibernate.transaction.TransactionManagerLookupFactory] (http-127.0.0.1-8080-1) No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
When trying to execute an update sql getting this exception :
Code:
ERROR [org.hibernate.ejb.AbstractEntityManagerImpl] (http-127.0.0.1-8080-1) Unable to mark for rollback on PersistenceException:
java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] No such transaction!
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.setRollbackOnly(BaseTransaction.java:191)
.
.
.
Code:
INFO [STDOUT] (http-127.0.0.1-8080-1) Executing an update/delete query
ERROR [STDERR] (http-127.0.0.1-8080-1) javax.persistence.TransactionRequiredException: Executing an update/delete query
ERROR [STDERR] (http-127.0.0.1-8080-1) at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:48)
.
.
.
I tried with the following property in my persistence.xml file :
Code:
<property name="hibernate.transaction.factory_class " value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="jta.UserTransaction" value="java:comp/UserTransaction"/>
But the problem is not solved. Am I missing something ?? or I will have to do some configuration changes in JBoss AS to use TransactionManager.
Thanks,
Ganesh