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 » Global transaction with DB2 and MQ

Post new topic  Reply to topic
 Global transaction with DB2 and MQ « View previous topic :: View next topic » 
Author Message
ram_s
PostPosted: Thu Mar 26, 2009 4:49 am    Post subject: Global transaction with DB2 and MQ Reply with quote

Newbie

Joined: 26 Mar 2009
Posts: 3

We have an MDB which picks message from a queueA , calls a stored procedure to do business logic and finally sends a response message to queueB .

Since database as well as Queue are involved, the MDB runs with a transaction type set to "Required" in a container managed transaction.

Given this, there is a specific condition which we are not able to achieve. In case of any business error returned by stored proc (Ex: Customer is invalid) then we have to intimate this error by sending a error message to the response queue. At the same time any database operations (inserts/updates) performed have to be rolledback.

The requirement is : In case of business errors, MDB has to write to a queue but within global transaction

We tried 2 options:
1. In case of business error, if we do a setRollbackOnly() the database and the request messages also gets rolledback.

2. We tired using SAVEPOINTS in the stored proc and do a Rollback to Savepoint in case of business errors. In this case it gives an exception that, Savepoint cannot be used in a Global transaction.

Can anyone help as to how to do this. I am using WAS6.0 and DB2 as database.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Thu Mar 26, 2009 5:06 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Are you using CMP or BMP? I think to achieve this, you have to use BMP.
Back to top
View user's profile Send private message
ram_s
PostPosted: Thu Mar 26, 2009 5:19 am    Post subject: Reply with quote

Newbie

Joined: 26 Mar 2009
Posts: 3

Entity beans are not used. Instead, the MDB calls a stored procedure in DB2 using JDBC.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Thu Mar 26, 2009 5:46 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

You can still use BMP within MDBs.
Back to top
View user's profile Send private message
ram_s
PostPosted: Thu Mar 26, 2009 6:02 am    Post subject: Reply with quote

Newbie

Joined: 26 Mar 2009
Posts: 3

The customer we are working isnt open to using BMPs since the existing methodology used is stored procedure thru jdbc.

Can we achive using this?
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Thu Mar 26, 2009 6:53 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

You can achieve it by getting the DB to rollback (or perform a compensating transaction) its work within the stored procedure and then indicating to the MDB that its failed.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 26, 2009 3:11 pm    Post subject: Reply with quote

Grand High Poobah

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

It is very unclear to me what you are trying to achieve.

In case of a problem do you want to
  • roll back DB2 but commit the MQ part with sending a message?
    Not a real multiphase commit here...
  • roll back DB2, roll back MQ and send a message (how many times will you send that message ? see bothresh

In my opinion this needs to be controlled with a number of different method and the transactionality on these methods needs to be set correctly...
Required vs Requires New etc...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Multiphase Commit » Global transaction with DB2 and MQ
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.