Posted: Mon Dec 06, 2010 3:32 pm Post subject: XA Transactions - Insert JMS message data to database in MDB
Novice
Joined: 15 Oct 2009 Posts: 14 Location: Zagreb, Croatia
Hi! I have problem to solve XA Transaction problem in environment where I want to insert received an JMS message data to database. My configuration is:
Websphere MQ 6 at iSeries (AS400)
DB2 at iSeries (AS400)
Websphere AS 6.1.0.23
EJB2 MDB configured to work with port listeners and ejb-jar.xml defines CONTAINER trans. type.
After I receive message from Q1 I insert record to DB and send new message to Q2. After program exits onMessage method I get:
WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.
[2010.12.06 18:47:48:723 CET] 0000002e RegisteredRes E WTRN0086I: XAException encountered during prepare phase for transaction 0000012CBCCBE7890000002900000002FB83566C90DA2584739BF5DBB45FED6518DACFED0000012CBCCBE7890000002900000002FB83566C90DA2584739BF5DBB45FED6518DACFED00000001. Local resources follow.
[2010.12.06 18:47:48:723 CET] 0000002e RegisteredRes E WTRN0089I: XATransactionWrapper@ c3d0c3d XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@6ab96ab9 enlisted: true mcWrapper.hashCode()19857711: Vote: commit.
[2010.12.06 18:47:48:723 CET] 0000002e RegisteredRes E WTRN0089I: XATransactionWrapper@ 21db21db XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@1d761d76 enlisted: true mcWrapper.hashCode()275648622: Vote: commit.
[2010.12.06 18:47:48:723 CET] 0000002e RegisteredRes E WTRN0089I: LocalTransactionWrapper@:574f574f localTransaction:com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl@57b257b2 enlisted:true registeredForSynctruemcWrapper.hashcode()1206208485: Vote: none.
[2010.12.06 18:47:48:739 CET] 0000002e ServerSession W WMSG0031E: Exception processing JMS Message for MDB MyMsgReceiver, JMSDestination jms/q1 : javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.websphere.csi.CSITransactionRolledbackException:
com.ibm.websphere.csi.CSITransactionRolledbackException:
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:817)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4321)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:107)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:492)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.websphere.csi.CSITransactionRolledbackException:
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:817)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4321)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:107)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:492)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Caused by: com.ibm.websphere.csi.CSITransactionRolledbackException:
... 8 more
That couses returning message at the top of Q1 and stoping listener port for Q1. What is sure, my DB2 Datasource iz not XA. I found how to configure an in infocenter but I'm not sure does case where listener ports are used is capable to achieve this scenario?
Can anybody provide any link on this subject? Most resources in infocenter are abstract and never use good examples to make problem solving easier.
Thanks!
This will commit the single phase resource last, with the proviso that things may be in an inconsistent state should that final commit fail. Otherwise, configure everything to be XA.
Joined: 15 Oct 2009 Posts: 14 Location: Zagreb, Croatia
Thanks for reply!
Today I did this:
- configured new JDBC Provider at WAS 6.1 to work with XA-compliant JDBC driver (DB2 UDB for iSiries - Toolbox XA)
- configured new XA Datasource
- maped resource references to XA datasource JNDI name
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum