Author |
Message
|
sandy2000 |
Posted: Wed Mar 18, 2009 9:06 pm Post subject: Distributed Transaction in Java using MQ and DB2 |
|
|
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 |
|
 |
fjb_saper |
Posted: Thu Mar 19, 2009 3:10 am Post subject: |
|
|
 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 |
|
 |
sandy2000 |
Posted: Thu Mar 19, 2009 7:00 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Thu Mar 19, 2009 7:04 am Post subject: |
|
|
 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 |
|
 |
sandy2000 |
Posted: Thu Mar 19, 2009 12:58 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Thu Mar 19, 2009 8:43 pm Post subject: |
|
|
 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 |
|
 |
Sam Uppu |
Posted: Fri Mar 20, 2009 6:47 am Post subject: Re: Distributed Transaction in Java using MQ and DB2 |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
|
Back to top |
|
 |
|