This is related to the topic "problem when using websphere MQ under heavy load". When I run load tests with MDBs reading from websphere MQ, writing to one database and then writing to another MQ, I run into errors. I sent IBM support a trace file and this is the response I have received. Can tomEE support help me out with this one -
+++ Begin feedback +++ . Hi MQ L2, >From the trace we can see the following sequence of events leading up to the XAER_NOTA return code on the XA Rollback call. Focusing on the transaction with Xid: "globalId=c000000047544d494400000000000000000000000000000000000000000000 0000000" 1) The Transaction Manager (TomEE) calls down into the WebSphere MQ Classes for JMS via the XA Interface to start the transaction: Mon Dec 02 12:58:11.379.0R wmqRA-worker-12 @238991e1 > JmqiXAResource.start(Xid,int ) [[Xid:globalId=c000000047544d49440000000000000000000000000000000000000 00000000000000,length=64,branchId=1000000047544d494400000000000000000000 0000000000000000000000000000000,length=64]] [0] . 2) The consume call is made to receive a message from destination "[queue:///TEST_USHA]" Mon Dec 02 12:58:11.393.0H wmqRA-worker-12 @65d99836 > JmsXASessionImpl(JmsSessionI mpl).consume(JmsMessageReference) . 3) A Message is consumed with Message ID: 414d5120514d5f4a415942495341575484378652208e9f0b, this is then delivered to the onMessage method of the MDB: Mon Dec 02 12:58:11.502.0Z wmqRA-worker-12 @3b09049b > MQSession$FacadeMessageListe ner.onMessage(Message) . 4) As part of the onMessage method, which is now customer code, an attempt to create a new connection is made: Mon Dec 02 12:58:11.504.09 wmqRA-worker-12 @60006c3 > ConnectionFactoryImpl(Connect ionFactoryImpl).createConnection() . 5) The createConnection call returns a resource exception as there are ManagedConnections available in the pool. This is an Apache connection pool by the look of the trace point. Mon Dec 02 12:58:16.551.03 wmqRA-worker-12 @505190f9 > DetailedJMSException.setLink edException(Exception) [javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 5000 [ms] ) for pool org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@7 a59e653] . 6) XA_End is called by the transaction manager on the transaction with the flag TMFAIL, this flag indicates that a portion of work has failed. Mon Dec 02 12:58:16.720.09 wmqRA-worker-12 @5d4539e4 ? XARWrapper(XARWrapper).end() <null> [Xid: [Xid:globalId=c000000047544d49440000000000000000000000000000000000000000 00000000000,length=64,branchId=1000000047544d494400000000000000000000000 0000000000000000000000000000,length=64], flags: TMFAIL] . 7) At this time I would like to point the customer at the XA Specification which describes how a resource manager (MQ) can act on the XA_End call with the TMFAIL flag set: "A resource manager might choose to mark a transaction branch as rollback-only at this point. In fact, a transaction manager does so for the global transaction. If a resource manager chooses to do so also, xa_end() returns one of the [XA_RB*] values" . 8) The Resource Manager, MQ in this case marks the transaction branch as rollback only as it's entitled to do so and returns the XA_RBROLLBACK errorcode '100'. Mon Dec 02 12:58:16.759.0T wmqRA-worker-12 @238991e1 < JmqiXAResource.end(Xid,int)< exitIndex 2> returns [javax.transaction.xa.XAException: The method 'xa_end' has failed with errorCode '100'.] . 9) When Rollback-only is set on the transaction branch the XA Specification explains that the Resource Manager can unilaterally roll back and forget a transaction branch any time before it prepares it: "An RM can also unilaterally roll back and forget a transaction branch any time before it prepares it. A TM detects this when an RM subsequently indicates that it does not recognise the XID". . 10) This is what MQ does after returning the XA_RBROLLBACK errorcode '100' on XA_End, it forgets the transaction, which is why when the transaction manager makes the XA_Rollback call MQ returns the errorCode '-4' which is "XAER_NOTA" indicating that it is not aware of the XID for which rollback has been called on. This is the correct and expected behaviour and we would expect the Transaction Manager to handle this appropriately. This issue is caused on step 5 as without a connection the onMessage method fails and the transaction rolls back. We cannot comment on the ResourceException as it is being thrown from non-IBM code. However I have pasted part of the exception stack below which should help the customer investigate this problem with TomEE Support: 12:58:16.551.05 0023 No ManagedConnections available within configured blocking timeout ( 5000 [ms] ) for pool org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@7 a59e653 [javax.resource.ResourceException] at: 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInter ceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:86) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.g etConnection(TransactionEnlistingInterceptor.java:49) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.get Connection(TransactionCachingInterceptor.java:101) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getCo nnection(ConnectionHandleInterceptor.java:43) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCC LInterceptor.java:39) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.get Connection(ConnectionTrackingInterceptor.java:66) 12:58:16.551.05 0023 org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocat eConnection(AbstractConnectionManager.java:81) 12:58:16.551.05 0023 com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConn ection(ConnectionFactoryImpl.java:194) 12:58:16.551.05 0023 com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnectionInte rnal(ConnectionFactoryImpl.java:153) 12:58:16.551.05 0023 com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(Con nectionFactoryImpl.java:138) 12:58:16.551.05 0023 com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createConnection(Con nectionFactoryImpl.java:123) 12:58:16.551.05 0023 com.test.TestMDB.initialize(TestMDB.java:93) 12:58:16.551.05 0023 com.test.TestMDB.onMessage(TestMDB.java:110) We have provided answers to the customer's follow up questions below: 1) "Customer wanted to know if there is an Aged TimeOut attribute setting for the MQ Resource Adapter(I did not find one and expect this would need to be configured at the application server level)." There is no Aged Timeout setting in the WebSphere MQ Resource Adapter, this is because the Resource Adapter does not provide connection pooling itself. A Connection Pool is typically provided by the application server, TomEE may have a setting that provides similar functionality, however that is a question for their support team. The technote in the PMR "http://www-01.ibm.com/support/docview.wss?uid=swg27023234" is targeted at users of the WebSphere Application Server and as such is not particularly relevant to the customer. We suggest they focus on the Resource Exception detailed above to resolve this problem. 2) "Do we support TomEE application server? My understanding is that if the server is a J2EE 1.4 (or later) compliant application server, then we support the environment." We will provide support to any application server that can successfully run the "WebSphere MQ resource adapter Installation Verification Test (IVT)". For more information on this please see the "Using the resource adapter with other application servers" section on the following link: http://www-01.ibm.com/support/docview.wss?uid=swg27023129 We hope this helps, Adam Clark . +++ End feedback +++ -- View this message in context: http://openejb.979440.n4.nabble.com/errorcode-100-when-using-websphere-MQ-with-tomee-tp4666519.html Sent from the OpenEJB User mailing list archive at Nabble.com.
