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 » Distributed Transaction in Java using MQ and DB2

Post new topic  Reply to topic
 Distributed Transaction in Java using MQ and DB2 « View previous topic :: View next topic » 
Author Message
sandy2000
PostPosted: Wed Mar 18, 2009 9:06 pm    Post subject: Distributed Transaction in Java using MQ and DB2 Reply with quote

Newbie

Joined: 18 Mar 2009
Posts: 4

I need to read/get the messages from MQ queue and make an insert into the DB2 database in Java stand alone program. Do I need to use XA transaction concept? XA resources etc.etc.. How can I ensure if DB2 insert fails, then message consumption from MQ queue also rolled back ? I do ot want to loose message of course !
One thing I know I need to use global transaction. Any sample code would be apperciated. Does it involve any XA configuration on MQ server where MQ queue resides.

Thanks you so much for quick reply.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 19, 2009 3:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If you want MQ to act as transaction manager you need to have the right switch file and configure the qmgr. DB2 will also need to reside on the same box as the qmgr...

Read the manual carefully. It should all be explained there.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sandy2000
PostPosted: Thu Mar 19, 2009 7:00 am    Post subject: Reply with quote

Newbie

Joined: 18 Mar 2009
Posts: 4

Thank you so much for reply. One thing is sure that our MQ is on different machine and DB2 is on different. So could you please suggest how it can be achieved in one global transaction ? We need to read the message and insert it into DB2. Would really appreciate your suggestion please.
Which manual you are referring to ?
Thank you so much.
Sandy
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 19, 2009 7:04 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sandy2000 wrote:
Which manual you are referring to ?


Start here and work forwards.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sandy2000
PostPosted: Thu Mar 19, 2009 12:58 pm    Post subject: Reply with quote

Newbie

Joined: 18 Mar 2009
Posts: 4

thanks. I apologize, but referring to above discussion I just want to confirm that is it possible to have global transaction if we have MQ and DB2 on different machine ?
Appreciate explanation please.
thank you.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 19, 2009 8:43 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

sandy2000 wrote:
thanks. I apologize, but referring to above discussion I just want to confirm that is it possible to have global transaction if we have MQ and DB2 on different machine ?
Appreciate explanation please.
thank you.

Yes but in your case you need an approved transaction monitor.
Try a J2EE TM with MQ as a resource manager (use .rar file)
Try WAS's TM or Weblogics TM
Try CICS's TM...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Sam Uppu
PostPosted: Fri Mar 20, 2009 6:47 am    Post subject: Re: Distributed Transaction in Java using MQ and DB2 Reply with quote

Yatiri

Joined: 11 Nov 2008
Posts: 610

MQ is not a transaction monitor but it will participate in XA transaction.
The below links may be useful:
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14028484&#14028484

http://www.ibm.com/developerworks/websphere/library/techarticles/0601_ritchie/0601_ritchie.html

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa13780_.htm

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Distributed Transaction in Java using MQ and DB2
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.