Bug 1301045

Summary: EAP 7 + WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Miroslav Novak <mnovak>
Component: JMSAssignee: John Jarvis <jjarvis>
Status: CLOSED CURRENTRELEASE QA Contact: Miroslav Novak <mnovak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jjarvis, jmesnil
Target Milestone: ---   
Target Release: TBD EAP 7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:24:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Novak 2016-01-22 12:32:31 UTC
This bugzilla is clone from jira: https://issues.jboss.org/browse/JBEAP-507 - and is used for tracking purpose for IBM:

TCK 7 tests -
com/sun/ts/tests/jms/ee/mdb/mdb_exceptQ/MDBClient.java#Test1
com/sun/ts/tests/jms/ee/mdb/mdb_exceptQ/MDBClient.java#Test15
com/sun/ts/tests/jms/ee/mdb/mdb_exceptQ/MDBClient.java#Test2

fail with following exception:

10:17:43,873 WARN  [com.arjuna.ats.jta] (default-threads - 7) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff7f000001:7e57664e:55b5e90b:3b, node_name=1, branch_uid=0:ffff7f000001:7e57664e:55b5e90b:3d, subordinatenodename=null, eis_name=java:/jms/QueueConnectionFactory > (XAResourceWrapperImpl@5fe54ccc[xaResource=com.ibm.mq.connector.xa.XARWrapper@554ad05 pad=false overrideRmValue=null productName=WebSphere MQ productVersion=%I% %E% %U% 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:881)

	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:369)
	at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:3018)

Cause:
There is MDB (bean managed) which is receiving message and based on content of the message is executing test in class com.sun.ts.tests.jms.commonee.ParentMsgBeanNoTx

public void onMessage(Message msg)  {

...

qConnection =

          qFactory.createQueueConnection();

       if (qConnection == null)

          throw new EJBException("MDB connection Error!");

 

       qSession = qConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

...

 

       runTests(msg, qSession, testName, p);


Important part is creation of connection "qConnection" which is closed unextedly in test Test1:

public void runGetRollbackOnlyBMT(Message msg, QueueSession qSession, 

                                  String testName) {

 

    result = false;

 

    try {

 

        // get beanManagedTx

        UserTransaction ut = mdc.getUserTransaction();

        ut.begin();

 

        //this should throw an exception

        try {

            mdc.getRollbackOnly();

 

            TestUtil.logErr("BMT MDB getRollbackOnly() Test Failed!");

        } catch (java.lang.IllegalStateException e) {

              result = true;

              TestUtil.logTrace("BMT MDB getRollbackOnly() Test Succeeded!");

              TestUtil.logTrace("Got expected IllegalStateException");

        }                

 

        ut.rollback();

 

    }catch (Exception e) {

        TestUtil.logErr("Unexpected exception: ", e);

    }

    // send a message to MDB_QUEUE_REPLY.

    JmsUtil.sendTestResults(testName,result,qSession,queueR);

}

Debugging showed that connection is closed by ut.rollback(); method. After analysis of trace logs com.arjuna there is enlistment of XAResource associated with connection to TM in call ut.begin(). This happens even if no operation related to this connection happens between ut.begin() and ut.rollback() method. TCK 7 does not expect connection to be closed if ut.rollback() is called. (I also tried to run the same test against ActiveMQ Artemis RA and saw that ut.rollback() does not close connection.)

Customer impact:
If UserTransaction.rollback() is called then any XA-capable connection created before will be closed. Workaround is to create new connection after call UserTransaction.rollback()..

As TCK 7 test and at least one other implementation of JMS RA is not closing connection after UserTransaction.rollback is called. This is considered as a bug in WebSphere MQ 8 RA.

Comment 2 JBoss JIRA Server 2016-02-29 14:11:56 UTC
Miroslav Novak <mnovak> updated the status of jira JBEAP-507 to Closed

Comment 3 John Jarvis 2019-02-07 23:24:19 UTC
closing old tracker bug

Comment 4 John Jarvis 2019-02-07 23:24:19 UTC
closing old tracker bug