This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1301045 - EAP 7 + WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection
EAP 7 + WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection
Status: NEW
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMS (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: TBD EAP 7
Assigned To: John Jarvis
Miroslav Novak
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-22 07:32 EST by Miroslav Novak
Modified: 2016-02-29 09:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEAP-507 Major Closed WebSphere MQ 8 RA - [TCK] UserTransaction.rollback() closes connection 2017-09-22 17:56 EDT

  None (edit)
Description Miroslav Novak 2016-01-22 07:32:31 EST
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 09:11:56 EST
Miroslav Novak <mnovak@redhat.com> updated the status of jira JBEAP-507 to Closed

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