-
Bug
-
Resolution: Obsolete
-
Critical
-
None
-
7.2.0.CD12, 7.2.0.CD14
-
None
If session is already created then UserTransaction.begin() does not start to treat work on session to be part of this session. Any message which is sent to queue using this already create session cannot be commited or rolled back by UserTransaction.begin()/rollback(). For example UserTransaction.rollback() will not rollback sent message. Application server logs:
14:56:35,674 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (default-threads - 1) wmq.jmsra.rar: MQJCA4026:Transaction backed out with reason: 'The method 'xa_end' has failed with errorCode '100'.'. 14:56:35,829 WARN [com.arjuna.ats.jta] (default-threads - 1) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2804ec:-54b8bdfa:5addd76b:22, node_name=1, branch_uid=0:ffff0a2804ec:-54b8bdfa:5addd76b:27, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory > (XAResourceWrapperImpl@e596d97[xaResource=com.ibm.mq.connector.xa.XARWrapper@6f58a270 pad=false overrideRmValue=null productName=IBM MQ productVersion=@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java jndiName=java:/jms/QueueConnectionFactory]) failed with exception code XAException.XAER_NOTA: javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'. at com.ibm.mq.jmqi.JmqiXAResource.rollback(JmqiXAResource.java:874) at com.ibm.mq.connector.xa.XARWrapper.rollback(XARWrapper.java:598) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.rollback(XAResourceWrapperImpl.java:196) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperStatImpl.rollback(XAResourceWrapperStatImpl.java:160) at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:362) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3023) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3002) at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1674) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:124) at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:186) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1371) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:143) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:134) at org.wildfly.transaction.client.LocalTransaction.rollbackAndDissociate(LocalTransaction.java:104) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at org.wildfly.transaction.client.ContextTransactionManager.rollback(ContextTransactionManager.java:83) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at org.wildfly.transaction.client.LocalUserTransaction.rollback(LocalUserTransaction.java:58) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.runTest8(MsgBeanxa.java:280) [mdb_msg_xa_ejb.jar:] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.runTests(MsgBeanxa.java:125) [mdb_msg_xa_ejb.jar:] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.onMessage(MsgBeanxa.java:81) [mdb_msg_xa_ejb.jar:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131] at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-7.2.0.CD12-redhat-3.jar:7.2.0.CD12-redhat-3] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103) [wildfly-ejb3-7.2.0.CD12-redhat-3.jar:7.2.0.CD12-redhat-3] at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58) [wildfly-ejb3-7.2.0.CD12-redhat-3.jar:7.2.0.CD12-redhat-3] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-7.2.0.CD12-redhat-3.jar:7.2.0.CD12-redhat-3] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:40) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53) ...
When checking trace logs from arjuna, connection was really associated with transaction:
2018-04-23 14:14:43,867 TRACE [com.arjuna.ats.jta] (default-threads - 1) XAResourceRecord.XAResourceRecord ( < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2804ec:-547aef4a:5addcda7:20, node_name=1, branch_uid=0:ffff0a2804ec:-547aef4a:5addcda7:25, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory >, XAResourceWrapperImpl@1544813b[xaResource=com.ibm.mq.connector.xa.XARWrapper@15dd0cdc pad=false overrideRmValue=null productName=IBM MQ productVersion=@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java jndiName=java:/jms/QueueConnectionFactory] ), record id=0:ffff0a2804ec:-547aef4a:5addcda7:26 2018-04-23 14:14:44,027 TRACE [com.arjuna.ats.arjuna] (default-threads - 1) RecordList::insert(RecordList: empty) : appending /StateManager/AbstractRecord/XAResourceRecord for 0:ffff0a2804ec:-547aef4a:5addcda7:26 2018-04-23 14:14:44,028 TRACE [com.arjuna.ats.jta] (default-threads - 1) TransactionImple.equals 2018-04-23 14:14:44,538 TRACE [com.arjuna.ats.jta] (default-threads - 1) BaseTransaction.rollback 2018-04-23 14:14:44,538 TRACE [com.arjuna.ats.jta] (default-threads - 1) TransactionImple.rollbackAndDisassociate 2018-04-23 14:14:44,538 TRACE [com.arjuna.ats.arjuna] (default-threads - 1) BasicAction::Abort() for action-id 0:ffff0a2804ec:-547aef4a:5addcda7:20 2018-04-23 14:14:44,540 TRACE [com.arjuna.ats.arjuna] (default-threads - 1) BasicAction::doAbort (XAResourceRecord < resource:XAResourceWrapperImpl@1544813b[xaResource=com.ibm.mq.connector.xa.XARWrapper@15dd0cdc pad=false overrideRmValue=null productName=IBM MQ productVersion=@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java jndiName=java:/jms/QueueConnectionFactory], txid:< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2804ec:-547aef4a:5addcda7:20, node_name=1, branch_uid=0:ffff0a2804ec:-547aef4a:5addcda7:25, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory >, heuristic: TwoPhaseOutcome.FINISH_OK, product: IBM MQ/@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java, jndiName: java:/jms/QueueConnectionFactory com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@66aa732c >) 2018-04-23 14:14:44,540 TRACE [com.arjuna.ats.jta] (default-threads - 1) XAResourceRecord.topLevelAbort for XAResourceRecord < resource:XAResourceWrapperImpl@1544813b[xaResource=com.ibm.mq.connector.xa.XARWrapper@15dd0cdc pad=false overrideRmValue=null productName=IBM MQ productVersion=@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java jndiName=java:/jms/QueueConnectionFactory], txid:< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2804ec:-547aef4a:5addcda7:20, node_name=1, branch_uid=0:ffff0a2804ec:-547aef4a:5addcda7:25, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory >, heuristic: TwoPhaseOutcome.FINISH_OK, product: IBM MQ/@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java, jndiName: java:/jms/QueueConnectionFactory com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@66aa732c >, record id=0:ffff0a2804ec:-547aef4a:5addcda7:26 2018-04-23 14:14:44,711 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (default-threads - 1) wmq.jmsra.rar: MQJCA4026:Transaction backed out with reason: 'The method 'xa_end' has failed with errorCode '100'.'. 2018-04-23 14:14:44,876 WARN [com.arjuna.ats.jta] (default-threads - 1) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2804ec:-547aef4a:5addcda7:20, node_name=1, branch_uid=0:ffff0a2804ec:-547aef4a:5addcda7:25, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory > (XAResourceWrapperImpl@1544813b[xaResource=com.ibm.mq.connector.xa.XARWrapper@15dd0cdc pad=false overrideRmValue=null productName=IBM MQ productVersion=@(#) MQMBID sn=p905-L180305.1 su=_9gWWFSCUEei3k49OBVxFGg pn=com.ibm.mq.connector/src/com/ibm/mq/connector/outbound/ManagedConnectionMetaDataImpl.java jndiName=java:/jms/QueueConnectionFactory]) failed with exception code XAException.XAER_NOTA: javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'. at com.ibm.mq.jmqi.JmqiXAResource.rollback(JmqiXAResource.java:874) at com.ibm.mq.connector.xa.XARWrapper.rollback(XARWrapper.java:598) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.rollback(XAResourceWrapperImpl.java:196) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperStatImpl.rollback(XAResourceWrapperStatImpl.java:160) at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:362) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3023) at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3002) at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1674) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:124) at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:186) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1371) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:143) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:134) at org.wildfly.transaction.client.LocalTransaction.rollbackAndDissociate(LocalTransaction.java:104) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at org.wildfly.transaction.client.ContextTransactionManager.rollback(ContextTransactionManager.java:83) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at org.wildfly.transaction.client.LocalUserTransaction.rollback(LocalUserTransaction.java:58) [wildfly-transaction-client-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.runTest8(MsgBeanxa.java:275) [mdb_msg_xa_ejb.jar:] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.runTests(MsgBeanxa.java:125) [mdb_msg_xa_ejb.jar:] at com.sun.ts.tests.jms.ee.mdb.xa.MsgBeanxa.onMessage(MsgBeanxa.java:81) [mdb_msg_xa_ejb.jar:]
however still when transaction is rolled back message stays in the queue.
TCK 7 tests failing because of this issue:
[javatest.batch] FAILED........com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test8 [javatest.batch] FAILED........com/sun/ts/tests/jms/ee/mdb/xa/MDBClient.java#Test9
Test snippet:
private void runTest8(Message msg,QueueSession qSession) { try { // Obtain the transaction demarcation interface. UserTransaction ut = mdc.getUserTransaction(); // start a transaction ut.begin(); // send a message to MDB_QUEUE_REPLY. JmsUtil.sendTestResults("xaTest8",false,qSession,queueR); // rollback the message ut.rollback(); <----- this does not rollback message sent as session was not created after ut.begin() ut.begin(); // send a message to MDB_QUEUE_REPLY. JmsUtil.sendTestResults("xaTest8",true,qSession,queueR); // rollback the message ut.commit(); }catch (Exception e) { TestUtil.printStackTrace(e); } }