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 Java / JMS » XA Transaction manager available in MQSeries?

Post new topic  Reply to topic
 XA Transaction manager available in MQSeries? « View previous topic :: View next topic » 
Author Message
sguhan
PostPosted: Tue Apr 29, 2003 9:11 am    Post subject: XA Transaction manager available in MQSeries? Reply with quote

Newbie

Joined: 29 Apr 2003
Posts: 3

I need to work with two queues. I have a standalone application which needs to pull messages off a queue say Q1, do some processing and put messages in a queue say Q2. All this has to happen in a single transaction. Since this is a standalone application (no application server support), it does not have a transaction manager available. MQSeries is used as the JMS Provider.

If I create two JMS sessions, one to pull messages off Q1 and one to put messages to Q2, then the standalone application has to commit Q2 session first and then Q1 session. But there is a window of failure when Q2 commits and then there is a crash. In this scenario, Q1 will not be committed and message will still be in the queue. How can this be avoided?

Can MQSeries act as a XATransaction manager? There are MQSeries API available for XAQueueSession etc but these are for use by the application server. My understanding is that MQSeries can act as a XAResource and not as an XA compliant TransactionManager.

How can I get my scenario to work as a single transaction?
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Apr 29, 2003 3:31 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

MQSeries CAN act as an XA Transaction Manager...
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
kingdon
PostPosted: Tue Apr 29, 2003 11:13 pm    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

Yes, it can, but you need to include some caveats. The most important of these in the context of the original question is that you can't use MQ as the transaction manager to control work done via the JMS API.

The normal way to solve the specified problem is to use local transactions, since there is only one transactional resource involved. This would require the two queues to be accessed via a single JMS Session, since it is the Session instance that scopes local transactions in JMS.

Local transactions are sufficient to ensure that the sending of a response message is tightly coupled to the removal of the request message. Distributed transactions are only necessary when two or more physically different resources need to be included in a single unit of work, for example a messaging system and a database.

Regards,
James.
Back to top
View user's profile Send private message
ceritnl
PostPosted: Wed Jul 30, 2003 10:43 pm    Post subject: Reply with quote

Newbie

Joined: 30 Jul 2003
Posts: 3
Location: Amsterdam

If both Queues are on the same QM, JMS can be used (local unit of work).
If Queues are on different QM, I think you have to use a global unit of work. This requires MQ API (if you want MQ to manage the global unit of work/ distributed transaction). JMS can only do this if you have an external transaction coordinator.
Back to top
View user's profile Send private message
techno
PostPosted: Mon Aug 04, 2003 9:19 am    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Can I use WebSphere Application Server as external transaction coordinator? (In case I am using JMS and want to have global transactions)

Thanks
Shiva
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 Java / JMS » XA Transaction manager available in MQSeries?
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.