Hello all, I'm getting a rather strange exception while using two separate persistence-units (one JTA, one RESOURCE_LOCAL). They are not being used at the same time. The transaction from one should be completed by time the other starts. The two PU's are using different data-sources, pointing at the same database.
Here is the exception:
Code:
23:50:25,938 WARN [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@2828c0
23:50:25,960 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
23:50:25,960 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >))
23:50:25,975 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
23:50:25,975 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >)
What I find especially strange is that after that exception occurs once, I can no longer create Transactions from the RESOURCE_LOCAL EntityManager:
Code:
23:51:00,004 ERROR [JDBCTransaction] JDBC commit failed
java.sql.SQLException: You cannot commit during a managed transaction!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
at com.n4systems.persistence.Transaction.commit(Transaction.java:39)
....
The Stateless EJB's using the JTA EntityManager continue to work correctly. This problem is killing me as for the most part, the two persistence-units work fine in the same container and I'm not sure what's different about the interaction in the spot where it fails.
Environment:
hibernate-3.3.1
hibernate-annotations-3.4.0
hibernate-entitymanager-3.4.0
JBoss-4.2.2GA
jdk-1.5.0_15
mysql-connector-java-5.1.8
Any help would be hugely appreciated.
Thanks
Mark