Issues with JBoss 4.2.2 XA Resources and Postgres 8.2.5
getkarthik Jul 29, 2008 7:56 PMHi
We are planning to migrate from JBoss 4.0.5 to JBoss 4.2.2. Until now our application was using Local Transactions even while persisting data into Multiple Databases [currently all databases residing on the same machine]. We are using postgres 8.2.5 as our database.
With the 4.2.2 version of JBoss local transactions were failing and we migrated to XA Datasources [and which I believe is the right way] and involve in 2PC. But we frequently encounter the problem of HeuristicMixedException with XA Transactions. The interesting thing to note was only a particualr DataBase was failing and we were using Native Query API from EJB3.0 for this particular DB. All other database are accessed via the standard EntityManager persist and merge operations. I am not sure if we shouldnt be calling flush() and executeUpdate() after every persist and NativeQuery update operations respectively on the EntityManager. I conducted tests changing the FlushModeType and calling EnityManager.joinTransaction() but nothing stops this failure.
Can anyone please advice.
Below is the exception:
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - java.lang.RuntimeException: javax.transaction.HeuristicMixedException
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:184)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at java.lang.Thread.run(Thread.java:595)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - Caused by: javax.transaction.HeuristicMixedException
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1397)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
org.jboss.logging.util.LoggerStream (LoggerStream.java:152) - ... 86 more