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 API Support » XA transaction not working with unixODBC on DB2

Post new topic  Reply to topic
 XA transaction not working with unixODBC on DB2 « View previous topic :: View next topic » 
Author Message
mandy13
PostPosted: Wed Apr 09, 2014 10:54 pm    Post subject: XA transaction not working with unixODBC on DB2 Reply with quote

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
View user's profile Send private message
Esa
PostPosted: Thu Apr 10, 2014 4:21 am    Post subject: Reply with quote

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
View user's profile Send private message
JosephGramig
PostPosted: Thu Apr 10, 2014 5:35 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1230
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
View user's profile Send private message AIM Address
mandy13
PostPosted: Thu Apr 10, 2014 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message
mandy13
PostPosted: Thu Apr 10, 2014 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Esa
PostPosted: Thu Apr 10, 2014 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message
mandy13
PostPosted: Thu Apr 10, 2014 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message
brian_homewood
PostPosted: Tue May 13, 2014 8:48 am    Post subject: XA transaction not working with unixODBC on DB2 Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue May 13, 2014 9:05 am    Post subject: Re: XA transaction not working with unixODBC on DB2 Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
brian_homewood
PostPosted: Wed May 14, 2014 12:16 am    Post subject: XA transaction not working with unixODBC on DB2 Reply with quote

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
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 API Support » XA transaction not working with unixODBC on 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.