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 » Multiphase Commit » XA issues

Post new topic  This topic is locked: you cannot edit posts or make replies.
 XA issues « View previous topic :: View next topic » 
Author Message
IntegratorWMB
PostPosted: Fri Jan 09, 2009 6:43 am    Post subject: XA issues Reply with quote

Apprentice

Joined: 06 Dec 2007
Posts: 27

Hi,

We have our own Enterprise app framework and it has a Transaction service which acts a wrapper for all transaction client request to JOTM transaction manager. most of our transaction falls in to one of these catagories:

a) xa start - db[1] update ....db[n] update - xa end
b) xa start - db[1] update - MQ send - db[2] update -xa end

The above scenarios working fine.

Now we are seeing issue with the following scenario

a) xa start - db[1] update - MQserver1 Q1 snd - MQserver1 Q2 snd - db[2] update - xa end

After MQserver1 Q1 snd the system seems to hang. Debugging shows the code hangs when we try to enlist the MQ server Q2 XA Resource with the Transaction manager (JOTM). Is this because both the queues are on the same physical MQ Server..

When I remove the enlist part for MQ Server Q2 ...the code fails trying to send the message with SYNCPOINT_NOT_AVAILABLE for Q2., when I ran the test for only one queue as part of XA, it works for both the queues. Here is the sample test code :

----
Jotm jotm = new Jotm(true, false);
TransactionManager tm = jotm.getTransactionManager();
XAResource mqXAResource1;
XAResource mqXAResource2;

Get the connection factory ....

XAConnection connection1 = connectionFactory.createXAConnection();
XASession session1 = connection1.createXASession();
mqXAResource1 = session1.getXAResource();

XAConnection connection2 = connectionFactory.createXAConnection();
XASession session2 = connection2.createXASession();
mqXAResource2 = session2.getXAResource();

connection1.start();
connection2.start();

MessageProducer producer1 = session1.getSession().createProducer(sndDest1);

MessageProducer producer2 = session2.getSession().createProducer(sndDest2);

tm.begin();
tm.getTransaction().enlistResource(mqXAResource1);
// Note: If the following line is uncommented code hangs here
tm.getTransaction().enlistResource(mqXAResource2);

producer1.send(session.createTextMessage("MESSAGE1"));

//If enlisting code above was commented the following line
// throws Completion Code 2, Reason 2072 error
producer2.send(session.createTextMessage("MESSAGE2"));


tm.getTransaction().delistResource(mqXAResource1, XAResource.TMSUCCESS);
tm.getTransaction().delistResource(mqXAResource2, XAResource.TMSUCCESS);

tm.commit();

// .... stop..close() for producers, sessions & connection done here

Any pointers appreciated.

Thanks.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 10, 2009 3:37 am    Post subject: Reply with quote

Grand High Poobah

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

See http://www.mqseries.net/phpBB2/viewtopic.php?p=235172#235172

Do not post in multiple forums ask a moderator to move your post.

locked.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  This topic is locked: you cannot edit posts or make replies. Page 1 of 1

MQSeries.net Forum Index » Multiphase Commit » XA issues
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.