2 Replies Latest reply on Jun 9, 2009 11:36 AM by juanignaciosl

    RollbackException:(...) Can't commit because the transaction

    juanignaciosl

      Environment:
      JDK 1.6
      JBoss 4.2.3.GA (jdk6 version)
      Teiid 6.1.0.M4
      Oracle database
      Two XA connections: my application uses Seam and jBPM, and it uses two XA datasources as suggested at Seam in Action book.

      Everything was working before Teiid. Now I'm trying to change the main connection (Seam persistence.xml) to be a Teiid one.
      I've followed the instructions at https://www.jboss.org/community/wiki/DeployingTeiidEmbeddedinJBossAS. When I try to load a page Teiid connection seem to work, since it shows several SQL statements, but ends throwing the following exception:

      GRAVE: Failed ending transaction for xid "< 131075, 27, 25, 1--3f57e6f7:d17:4a2e5317:aa-3f57e6f7...
      com.metamatrix.jdbc.MMSQLException: Client is not currently enlisted in transaction MMXid global:20230026769060452013644054514146383048327827783535660350343635297 branch:283729884023434846293733663487045175814294804081346734612837 format:131075.
       at com.metamatrix.jdbc.MMSQLException.create(MMSQLException.java:82)
       at com.metamatrix.jdbc.MMSQLException.create(MMSQLException.java:63)
       at com.metamatrix.jdbc.MMConnection.endTransaction(MMConnection.java:813)
       at com.metamatrix.jdbc.MMXAResource.end(MMXAResource.java:88)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.end(XAManagedConnection.java:158)
       at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.end(JcaXAResourceWrapper.java:58)
       at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:633)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2619)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1779)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
       at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
       at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:614)
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:605)
       at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:343)
       at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
       at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
       at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
      
      ...
      
      Caused by: [XATransactionException]Client is not currently enlisted in transaction MMXid global:20230026769060452013644054514146383048327827783535660350343635297 branch:283729884023434846293733663487045175814294804081346734612837 format:131075.
       at org.teiid.dqp.internal.transaction.TransactionServerImpl.checkXAState(TransactionServerImpl.java:348)
       at org.teiid.dqp.internal.transaction.TransactionServerImpl.end(TransactionServerImpl.java:298)
       at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
      
      ...
      
      14:23:14,312 ERROR [XAManagedConnectionFactory] End transaction failed for XAResource
      javax.transaction.xa.XAException
       at com.metamatrix.common.xa.XATransactionException.getXAException(XATransactionException.java:105)
       at com.metamatrix.jdbc.MMXAResource.handleError(MMXAResource.java:76)
       at com.metamatrix.jdbc.MMXAResource.end(MMXAResource.java:91)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.end(XAManagedConnection.java:158)
      
      ...
      
      Caused by: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1401)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
       at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
       at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:614)
       ... 49 more
      
      


      After that (as I write this) it keeps repeating the following error message
      14:23:37,578 INFO [STDOUT] 14:23:37,578 WARN [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR
      14:23:37,609 INFO [STDOUT] 14:23:37,609 WARN [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR
      14:25:47,625 INFO [STDOUT] 14:25:47,625 WARN [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR
      14:25:47,656 INFO [STDOUT] 14:25:47,656 WARN [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR
      


        • 1. Re: RollbackException:(...) Can't commit because the transac
          shawkins

          The error message indicates that the connection is associated with a transaction other than the one that is specified in the end call. Try rerunning with the {embeeded root}/deploy.properties setting dqp.logLevel=5

          That will give detail messages from all interactions with our TransactionServer. You'll want to look at the sequence of calls related to the connection(s) related to the transaction that is failing.

          • 2. Re: RollbackException:(...) Can't commit because the transac
            juanignaciosl

            SOLVED, thank you very much!!!!

            After setting debug level to 5 I looked more carefully to the parameters of the transaction. In spite of not being a Oracle datasource I had to add some parameters I use at the other datasource:

            <track-connection-by-tx>true</track-connection-by-tx>
            <isSameRM-override-value>false</isSameRM-override-value>
            <no-tx-separate-pools />
            


            Those are used with Oracle pools like the other one, it's documented.

            Thanks!!