ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » XA Transactions - Insert JMS message data to database in MDB

Post new topic  Reply to topic
 XA Transactions - Insert JMS message data to database in MDB « View previous topic :: View next topic » 
Author Message
igor.beslic
PostPosted: Mon Dec 06, 2010 3:32 pm    Post subject: XA Transactions - Insert JMS message data to database in MDB Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
JLRowe
PostPosted: Tue Dec 07, 2010 3:18 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

A mix of a single phase resource with XA resource(s) requires the enabling of last participant support:

http://publib.boulder.ibm.com/infocenter/adiehelp/v5r1m1/index.jsp?topic=/com.ibm.wasee.doc/info/ee/webui_pme/ui/ueac_laoextensionsettings.html

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.
Back to top
View user's profile Send private message Send e-mail
igor.beslic
PostPosted: Tue Dec 07, 2010 12:32 pm    Post subject: Reply with quote

Novice

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

Now problem is solved. This is realy great.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » XA Transactions - Insert JMS message data to database in MDB
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.