2 Replies Latest reply on Oct 2, 2002 8:46 AM by talg

    local transaction problem

    otembajelle

      I took the chap7 example (NoTransaction) and upgraded to LocalTransaction. The example has a bean usíng CMT. The log shows that the transaction begins. Unfortunately it does not commit but throws an Exception instead ...

      12:38:43,173 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=DellJelle//1, BranchQual=] errorCode=XA_UNKNOWN(0)
      javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257, GlobalId=DellJelle//1, BranchQual=1]
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.rollback(LocalTxConnectionManager.java:640)
      at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1727)
      at org.jboss.tm.TxCapsule.rollback(TxCapsule.java:441)
      at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:83)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:191)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:711)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:142)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)
      at java.lang.Thread.run(Thread.java:484)

      Could anyone help me out?

        • 1. Re: local transaction problem
          otembajelle

          The problem was my misconception in the sequence of creating the connection and the begin of a local transaction that used it. Of course the transaction begins before the getConnection() is called. I only had to move the creation of the connection to the ctor of the ManagedConnection. Problem solved.

          • 2. Re: local transaction problem
            talg

            Hi,

            Can you provide more details on how you solved this problem? i am facing the exact same problem.

            Thanks,
            Tal