Author |
Message
|
mandy13 |
Posted: Wed Apr 09, 2014 10:54 pm Post subject: XA transaction not working with unixODBC on DB2 |
|
|
Apprentice
Joined: 17 Apr 2013 Posts: 28
|
Hi,
I am trying to get XA transactions work using unixODBC driver for DB2 database and WMQ Manager
Default Auto Commit has been turned off
Following are the configurations:
UnixODBC => odbc.ini
Quote: |
Driver = DB2_DRIVER
Database = DBNAME
uid = username
pwd = password |
WMQ => qm.ini
Quote: |
XAResourceManager:
Name=xa_name
SwitchFile=db2swit
XAOpenString=DBNAME,username,password,toc=p,hold_cursor=t
ThreadOfControl=PROCESS |
Following are the steps that I follow in my program
1. MQBEGIN
2. Database connectivity
3. MQGET
4. Insert in DB
5. Disconnect DB
6. MQCMIT
After doing the mentioned steps message gets removed from MQ queue but not committed in database. Can anyone please tell me if I am missing some configuration here.
Versions of softwares used
unixODBC => 2.3.2
Websphere MQ => 7.1.0.0
DB2 client => 9.7 fix pack 4
Thanks in advance  |
|
Back to top |
|
 |
Esa |
Posted: Thu Apr 10, 2014 4:21 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Disconnecting from the database before committing doesn't sound right.
Neither does MQBEGIN before connecting to the database. |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Apr 10, 2014 5:35 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
Not that this is your problem but your WMQ 7.1.0.0 really needs maintenance. |
|
Back to top |
|
 |
mandy13 |
Posted: Thu Apr 10, 2014 6:23 am Post subject: |
|
|
Apprentice
Joined: 17 Apr 2013 Posts: 28
|
Esa wrote: |
Disconnecting from the database before committing doesn't sound right.
Neither does MQBEGIN before connecting to the database. |
I have already tried disconnecting after committing and MQBEGIN after connecting to database, but results are the same. |
|
Back to top |
|
 |
mandy13 |
Posted: Thu Apr 10, 2014 6:29 am Post subject: |
|
|
Apprentice
Joined: 17 Apr 2013 Posts: 28
|
Some more information:
My MQ Server and the application program are on the same host but DB2 resides on a different host.
Also with the same setup XA transactions work fine with embedded SQL but not with unixODBC. |
|
Back to top |
|
 |
Esa |
Posted: Thu Apr 10, 2014 6:45 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Did you configure DB2 and
Code: |
db2 update dbm cfg using TP_MON_NAME mqmax |
? |
|
Back to top |
|
 |
mandy13 |
Posted: Thu Apr 10, 2014 7:03 am Post subject: |
|
|
Apprentice
Joined: 17 Apr 2013 Posts: 28
|
Esa wrote: |
Did you configure DB2 and
Code: |
db2 update dbm cfg using TP_MON_NAME mqmax |
? |
DB2 is configured to use TP_MON_NAME as mqmax |
|
Back to top |
|
 |
brian_homewood |
Posted: Tue May 13, 2014 8:48 am Post subject: XA transaction not working with unixODBC on DB2 |
|
|
Newbie
Joined: 09 Apr 2002 Posts: 4
|
Did you ever get this working? If not it might be the unixODBC driver for DB2 is not registering with MQ. You could try doing static static registration, build yourself db2swits rather than db2swit, and set sreg=t in the XAOpenString. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue May 13, 2014 9:05 am Post subject: Re: XA transaction not working with unixODBC on DB2 |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
mandy13 wrote: |
I am trying to get XA transactions work using unixODBC driver for DB2 database and WMQ Manager |
What results are you getting? Any errors? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
brian_homewood |
Posted: Wed May 14, 2014 12:16 am Post subject: XA transaction not working with unixODBC on DB2 |
|
|
Newbie
Joined: 09 Apr 2002 Posts: 4
|
I haven't tried using the unixODBC driver myself, but since the XA specification was written around 'C', the dynamic registration part of it isn't usually well supported by other types of interface, hence DB2 introduced support for static registration. We always recommend with JDBC that you use static registration, hence my suggestion to use static registration with the unixODBC driver. |
|
Back to top |
|
 |
|