5 Replies Latest reply on Aug 21, 2007 12:48 AM by Tatsuhiro Shimada

    The committed case was found even if the error of XA occurs

    Tatsuhiro Shimada Newbie

      When I see the log,
      the committed case was found even if the error of XA occurs.

      Please look at the following log.

      Is it BUG of JBoss Transaction?

      21:39:57,145 TRACE [TransactionImpl] Created new instance for tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487]
      21:39:57,145 TRACE [TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] status=STATUS_ACTIVE
      21:39:57,145 TRACE [TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] status=STATUS_ACTIVE
      21:39:57,146 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=1, localId=487]) entered: com.ibm.mq.MQXAResource@72176d9f flags=0
      21:39:57,148 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=1, localId=487]) leaving: com.ibm.mq.MQXAResource@72176d9f flags=0
      21:39:57,148 TRACE [TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] status=STATUS_ACTIVE
      21:39:57,154 INFO [ jms.JMSGetter] Message GET OK
      21:39:57,155 TRACE [TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] status=STATUS_ACTIVE
      21:39:57,155 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=2, localId=487]) entered: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49 flags=0
      21:39:57,159 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=2, localId=487]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49 flags=0
      21:39:57,293 TRACE [TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] status=STATUS_ACTIVE
      21:39:57,293 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=3, localId=487]) entered: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98 flags=0
      21:39:57,300 TRACE [TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=3, localId=487]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98 flags=0
      21:39:57,623 TRACE [TransactionImpl] Committing, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487], status=STATUS_ACTIVE
      21:39:57,623 TRACE [TransactionImpl] calling sync 0, org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor$InstanceSynchronization@1fb5ec96 tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487]
      21:39:57,623 TRACE [TransactionImpl] calling sync 1, org.jboss.resource.connectionmanager.TransactionSynchronizer@3eb4aca9 tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487]
      21:39:57,623 TRACE [TransactionImpl] Before completion done, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487], status=STATUS_ACTIVE
      21:39:57,623 TRACE [TransactionImpl] endresources(com.ibm.mq.MQXAResource@72176d9f): state=1
      21:39:57,623 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=1, localId=487]) entered: com.ibm.mq.MQXAResource@72176d9f flag=67108864
      21:39:57,624 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=1, localId=487]) leaving: com.ibm.mq.MQXAResource@72176d9f flag=67108864
      21:39:57,624 TRACE [TransactionImpl] endresources(org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49): state=1
      21:39:57,624 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=2, localId=487]) entered: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49 flag=67108864
      21:39:57,625 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=2, localId=487]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49 flag=67108864
      21:39:57,625 TRACE [TransactionImpl] endresources(org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98): state=1
      21:39:57,625 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=3, localId=487]) entered: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98 flag=67108864
      21:39:57,627 TRACE [TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=3, localId=487]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98 flag=67108864
      21:39:57,627 TRACE [TransactionImpl] Two phase commit TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487]: Many resources.
      21:39:57,748 TRACE [TransactionImpl] Committing resource com.ibm.mq.MQXAResource@72176d9f state=5
      21:39:57,765 TRACE [TransactionImpl] Committing resource org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6aa4ee49 state=4
      21:39:57,765 TRACE [TransactionImpl] Committing resource org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@6f9dac98 state=5
      21:39:58,531 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487] errorCode=XAER_RMERR
      21:39:58,597 WARN [TransactionImpl] xa error: -3 (A resource manager error has occured in the transaction branch.); oracle error: 17410; oracle sql error: 0;
      oracle.jdbc.xa.OracleXAException
      at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1438)
      at oracle.jdbc.xa.client.OracleXAResource.commit(OracleXAResource.java:683)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.commit(XAManagedConnection.java:176)
      at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2141)
      at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1674)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:330)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:454)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:322)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      at org.jboss.ejb.Container.invoke(Container.java:870)
      at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
      at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java(Compiled Code))
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java(Inlined Compiled Code))
      at org.jboss.mx.server.Invocation.invoke(Invocation.java(Compiled Code))
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java(Compiled Code))
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java(Compiled Code))
      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:115)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:101)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:106)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91)
      at $Proxy45.invoke(Unknown Source)
      ?
      ?
      ?
      ?
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:570)
      21:39:58,616 TRACE [TransactionImpl] Committed OK, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=c1sjg18dy/487, BranchQual=, localId=487]

        • 1. Re: The committed case was found even if the error of XA occ
          Mark Little Master

          You want to give us a clue as to which version of AS you're running with?

          • 2. Re: The committed case was found even if the error of XA occ
            Tatsuhiro Shimada Newbie

            I am sorry in the dearth of information.
            The version uses JBoss4.0.1sp1.

            • 3. Re: The committed case was found even if the error of XA occ
              Jonathan Halliday Master

              The default transaction manager in 4.0.x does not have particularly good handling of heuristic outcomes such as this. I recommend trying 4.2 or adding JBossTS to 4.0.5

              • 4. Re: The committed case was found even if the error of XA occ
                Tatsuhiro Shimada Newbie

                Mr. jhalliday, Thank you for the answer.

                It might solve by raising the version of JBoss.?

                But I want to know the cause.

                In org.jboss.tm.TransactionImpl class,

                /**
                * Commit all enlisted resources.
                * This will release the lock while calling out.
                */
                private void commitResources(boolean onePhase)
                {
                status = Status.STATUS_COMMITTING;

                for (int i = 0; i < resources.size(); ++i)
                {

                // Abort commit on state change.
                if (status != Status.STATUS_COMMITTING)
                return;

                Resource resource = (Resource) resources.get(i);

                // Ignore the last resource, it is already committed
                if (onePhase == false && lastResource == resource)
                continue;

                try
                {
                resource.commit(onePhase);
                }
                catch (XAException e)
                {
                logXAException(e);
                switch (e.errorCode) {
                case XAException.XA_HEURRB:
                case XAException.XA_HEURCOM:
                case XAException.XA_HEURMIX:
                case XAException.XA_HEURHAZ:
                //usually throws an exception, but not for a couple of cases.
                gotHeuristic(resource, e.errorCode);
                //May not be correct for HEURCOM
                //Two phase commit is committed after prepare is logged.
                if (onePhase)
                status = Status.STATUS_MARKED_ROLLBACK;

                break;
                default:
                cause = e;
                if (onePhase)
                {
                status = Status.STATUS_MARKED_ROLLBACK;
                break;
                }
                //Not much we can do if there is an RMERR in the
                //commit phase of 2pc. I guess we try the other rms.
                }
                }
                catch (Throwable t)
                {
                if (trace)
                log.trace("unhandled throwable in commitResources " + this, t);
                }
                }

                if (status == Status.STATUS_COMMITTING)
                status = Status.STATUS_COMMITTED;
                }


                Why nothing is done if XAERRMERR in errorCode and twoPhase when XAException is generated.

                What intention is?"Not much we can do if there is an RMERR in the commit phase of 2pc. I guess we try the other rms." ?
                ?

                • 5. Re: The committed case was found even if the error of XA occ
                  Tatsuhiro Shimada Newbie

                   

                  "cimatch" wrote:
                  Mr. jhalliday, Thank you for the answer.

                  It might solve by raising the version of JBoss.?

                  But I want to know the cause.

                  In org.jboss.tm.TransactionImpl class,

                  /**
                  * Commit all enlisted resources.
                  * This will release the lock while calling out.
                  */
                  private void commitResources(boolean onePhase)
                  {
                  status = Status.STATUS_COMMITTING;

                  for (int i = 0; i < resources.size(); ++i)
                  {

                  // Abort commit on state change.
                  if (status != Status.STATUS_COMMITTING)
                  return;

                  Resource resource = (Resource) resources.get(i);

                  // Ignore the last resource, it is already committed
                  if (onePhase == false && lastResource == resource)
                  continue;

                  try
                  {
                  resource.commit(onePhase);
                  }
                  catch (XAException e)
                  {
                  logXAException(e);
                  switch (e.errorCode) {
                  case XAException.XA_HEURRB:
                  case XAException.XA_HEURCOM:
                  case XAException.XA_HEURMIX:
                  case XAException.XA_HEURHAZ:
                  //usually throws an exception, but not for a couple of cases.
                  gotHeuristic(resource, e.errorCode);
                  //May not be correct for HEURCOM
                  //Two phase commit is committed after prepare is logged.
                  if (onePhase)
                  status = Status.STATUS_MARKED_ROLLBACK;

                  break;
                  default:
                  cause = e;
                  if (onePhase)
                  {
                  status = Status.STATUS_MARKED_ROLLBACK;
                  break;
                  }
                  //Not much we can do if there is an RMERR in the
                  //commit phase of 2pc. I guess we try the other rms.
                  }
                  }
                  catch (Throwable t)
                  {
                  if (trace)
                  log.trace("unhandled throwable in commitResources " + this, t);
                  }
                  }

                  if (status == Status.STATUS_COMMITTING)
                  status = Status.STATUS_COMMITTED;
                  }


                  Why nothing is done if XAERRMERR in errorCode and twoPhase when XAException is generated.?

                  What intention is "Not much we can do if there is an RMERR in the commit phase of 2pc. I guess we try the other rms." ?