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 » WebSphere Message Broker (ACE) Support » Question on Transaction Management

Post new topic  Reply to topic
 Question on Transaction Management « View previous topic :: View next topic » 
Author Message
bprasana
PostPosted: Thu May 06, 2010 4:32 pm    Post subject: Question on Transaction Management Reply with quote

Disciple

Joined: 18 Apr 2005
Posts: 179

I am sure this is a common scenario.

Requirement says : Update 2 applications in a Transaction.
One is a database that a Broker can access.
The other one is a Mainframe system, with no rollback capability.We interact through MQ Queues.

Which is the best way to handle this?

Do i update 'local' database first but hold the commit till I update a Mainframe system? (is it possible??).

Thanks
bprasana
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu May 06, 2010 9:50 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

do you get a reply message showing success/failure from the MF?

Your question does not indicate this
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
bprasana
PostPosted: Thu May 06, 2010 9:52 pm    Post subject: yes Reply with quote

Disciple

Joined: 18 Apr 2005
Posts: 179

Yes..I will get a notification from MF. for Success and Fail
Back to top
View user's profile Send private message
fatherjack
PostPosted: Fri May 07, 2010 12:37 am    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

bprasana wrote:
Update 2 applications in a Transaction.


You can't in your scenario.

smdavies99 wrote:
do you get a reply message showing success/failure from the MF?


It doesn't matter whether you do or not.

For example, what if you get a success response from m/f then your database update fails. And how long are you going to wait for a response from m/f? Forever? What if you give up waiting - do you rollback your database update on the assumption your m/f app has failed. What happens then if the success message arrives late from m/f.

The scope of your transaction should be updating the database and putting the message to the queue and then committing that. The mainframe transaction is a separate transaction which gets the message and updates its resources and commits. If the mainframe transaction fails you'll need to implement something else to handle this scenario - maybe a compensating transaction, or some form of retry or maybe even manual intervention.

Or don't use WMB and MQ but rather use a distributed transaction processing monitor which can manage the distributed transaction as a single UOW.
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
bprasana
PostPosted: Fri May 07, 2010 4:44 pm    Post subject: thanks Reply with quote

Disciple

Joined: 18 Apr 2005
Posts: 179

Thanks fatherjack
I guess thats the approach I need to take. Since i dont have option of replacing WMB/MQ
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri May 07, 2010 11:02 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The reason I asked if there is a success/fail message coming back from the M/F is that is there is, you can put a MQGet node in your flow with a timeout and if that expires then you can roll back the other work just as if you got a failure.

You are sort of doing a one message aggregation. Fire off a request and then wait a while for it to complete. If nowt comes back then roll everything back.
If failure comes back, roll everything back.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
bprasana
PostPosted: Sat May 08, 2010 6:13 pm    Post subject: Correct, But.. Reply with quote

Disciple

Joined: 18 Apr 2005
Posts: 179

what fatherjack said is also correct. What will happen if the success response comes in late. I really dont have any mechanism to roll back that.

I need to probably have another monitoring flow which will check for these replies and update the database automatically.

But coming back to your point smdavies99, how would the design look like in ur case?

If I were to update my database first using a stored proc for db2 9.5 and then send MQ ms to update Mainframe. will i still be able to hold the commit for my database till i get msg back from mainframe.?

or do you suggest updating the MF first and then the db2?

thanks
bprasana
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun May 09, 2010 12:41 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

It depends...

If you are doing the DB2 insert in a flow that is transactional then you could do it before the MF Send./receive.
If your flow is not transactional and you do it before the MF operation then if it failed you would have to then delete the updated data manually. This is what is known as a compensating transaction.

In the latter case I'd probably do the MF operation first. Then you only need to do the DB2 operation if you get Success back.

Ok, this is a pretty simplistic answer. There is most certainly a lot more things to consider in an operation like this that is outside the scope of this forum.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » WebSphere Message Broker (ACE) Support » Question on Transaction Management
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.