Bug 1301045 - EAP 7 + WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection
Summary: EAP 7 + WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMS
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: TBD EAP 7
Assignee: John Jarvis
QA Contact: Miroslav Novak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-22 12:32 UTC by Miroslav Novak
Modified: 2019-02-07 23:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:24:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-507 0 Major Closed WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection 2018-04-24 08:21:12 UTC

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


Note You need to log in before you can comment on or make changes to this bug.