Author |
Message
|
sebastia |
Posted: Tue Dec 16, 2008 8:19 am Post subject: Transaction manager configuration |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
I am trying to use MQ to coordinate
a MQ_PUT() and DB2_INSERT_TABLE() operations,
using MQ as transaction Manager.
I am reading
1) mq v6 sys admin guide, chapter 11, "Transactional support"
2) mq v6 app programming guide, chapter 13, "commit ... uow"
3) mq v6 app prog ref, chapter 3, "MQBO options"
And here is the phrase / job to do
I dont understand how to do : (from [2], pg 176)
"When you use MQBEGIN to start a global unit of work, all the external resource managers that have been configured with the queue manager are included"
Well - the question is simple :
how do I tell MQ what external resource managers do I have ?
In my case, it is a DB2 Resource Manager, AFAIK.
Thanks for any pointer. Seb |
|
Back to top |
|
 |
sebastia |
Posted: Tue Dec 16, 2008 8:40 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
mq v6 Sys Admin Guide page 175 :
In general, a global unit of work is implemented in an application
by the following method (in pseudocode):
MQBEGIN
MQGET (include the flag MQGMO_SYNCPOINT in the message options)
MQPUT (include the flag MQPMO_SYNCPOINT in the message options)
SQL INSERT
MQCMIT
At what moment do we declare what DB2 table or resource
has to be Committed ???
I have seen a small lite : "SWITCH FILES" ... |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 16, 2008 8:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You need to configure the queue manager to participate in an XA group with an XA coordinator. This configuration is performed using the switch files you mention. DB2 must be configured to use the same coordinator.
Once this has been achieved, committing the UOW will commit all the resources thus controlled, both WMQ & DB2. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sebastia |
Posted: Tue Dec 16, 2008 8:55 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
I am reading the MQ configuration, this is the switch file
How is DB2 notified it is part of XA ? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 16, 2008 8:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sebastia wrote: |
How is DB2 notified it is part of XA ? |
I've no idea. Ask Mr Google or post on a DB2 forum.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sebastia |
Posted: Tue Dec 16, 2008 9:55 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
Thanks, Vitor.
I'll stay with "mq v6 Sys Admin Guide", chapter 11.
Now I am at "Changing DB2 configuration parameters"
>>>
For each DB2 database that the queue manager is coordinating, you need to:
etc etc
( ) |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 16, 2008 11:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sebastia wrote: |
Now I am at "Changing DB2 configuration parameters"
|
Ok, that'd probably work ok as well.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mvic |
Posted: Wed Dec 17, 2008 3:55 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
sebastia wrote: |
How is DB2 notified it is part of XA ? |
Best to ask on a DB2 forum, but here's my idea of what happens:
- During the first MQBEGIN, the MQ library code in the app makes an xa_open call into DB2.
- DB2 creates an "XA connection" as part of this xa_open.
- <<I don't think they would call it that, but let's call it that.>>
- XA connections are bound to the current OS thread.
- When you call SQLConnect(NULL,NULL) or similar, you get a DB2 handle for that XA connection.
- So now you have an MQ handle, and a DB2 handle (with its underlying XA connection that was created by the first MQBEGIN) both bound to the current thread.
Hopefully this answers the question.
Hopefully it is also correct - as I mentioned, though, please ask on a DB2 forum to find the DB2 experts. |
|
Back to top |
|
 |
sebastia |
Posted: Thu Dec 18, 2008 12:48 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
OK - thanks a lot.
I guess it is time to run some testing ...
Cheers ! |
|
Back to top |
|
 |
|