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 » TimeoutNotification and Throw to rollback transaction

Post new topic  Reply to topic
 TimeoutNotification and Throw to rollback transaction « View previous topic :: View next topic » 
Author Message
misun
PostPosted: Mon Dec 06, 2010 1:02 pm    Post subject: TimeoutNotification and Throw to rollback transaction Reply with quote

Newbie

Joined: 06 Dec 2010
Posts: 6

Hi,

I've developed a flow triggered by TimeoutNotification and when it experience an error, it should Throw the error and rollback the transaction. When I was developing I was expecting it to behave like how MQ input queue would work with 0 backout allowance. However with TimeoutNotification node, it would endlessly retry the error and won't rollback.

How do I actually cause an error to terminate the flow started by TimeoutNotification node?

Thanks heaps in advance
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 06, 2010 1:36 pm    Post subject: Re: TimeoutNotification and Throw to rollback transaction Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

misun wrote:
How do I actually cause an error to terminate the flow started by TimeoutNotification node?


You need to connect the Catch and Failure terminals & not abend as described here

misun wrote:
When I was developing I was expecting it to behave like how MQ input queue would work with 0 backout allowance


Why? That link clearly states, for a number of scenarios:

Quote:
the TimeoutNotification node tries to process the message again until the problem is resolved.



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 06, 2010 1:40 pm    Post subject: Re: TimeoutNotification and Throw to rollback transaction Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

misun wrote:
how MQ input queue would work with 0 backout allowance.


Slightly off topic, but the MQInput node doesn't have a 0 backout allowance; it has the backout allowance specified on the queue it's reading.

Not relevant to this problem and more for the benefit of future readers who may stumble across this thread.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
misun
PostPosted: Mon Dec 06, 2010 1:48 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2010
Posts: 6

I do have catch and failure node connected to TimeoutNotification, but if I handle the error, the flow doesn't rollback as I expected.

The problem I have is, the flow write an output queue then try to update the database. If it have problem updating the database, it should retrieve back the message sent to the output queue. With proper error handling, the sent messages are still in the output queue...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Dec 06, 2010 2:11 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.

Your problem is really to do with transactionality.
If the write to the WMQ Output Queue is not comitted then if the DB update fails a rollback of the thread will also rollback the WMQ Write.

My suggestion is to read up me the subject of transactionality & Units of work.
_________________
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
misun
PostPosted: Mon Dec 06, 2010 2:59 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2010
Posts: 6

I've created a simplified version:

TimeoutNotification (TransactionMode=yes) - MQOutput (TransactionMode =yes) - Throw

with TimeoutNotification's catch node connected to Trace

The output queue still have the message in it after the Throw.

How do I make it really transactional? I must be missing something...
Back to top
View user's profile Send private message
misun
PostPosted: Mon Dec 06, 2010 5:25 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2010
Posts: 6

I couldn't figure out alternative solution.

Ended up adding queue logic between the TimeoutNotification and rest of the flow.

TimeoutNotification - OutputQueue

InputQueue - rest of the flow
Back to top
View user's profile Send private message
fatherjack
PostPosted: Tue Dec 07, 2010 3:25 am    Post subject: Reply with quote

Knight

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

misun wrote:
I've created a simplified version:

TimeoutNotification (TransactionMode=yes) - MQOutput (TransactionMode =yes) - Throw

with TimeoutNotification's catch node connected to Trace

The output queue still have the message in it after the Throw.

How do I make it really transactional? I must be missing something...


Again the doc is pretty clear. It says:

Quote:
The message is written to the Catch terminal as part of the same transaction, and if the flow connected to the Catch terminal handles the error successfully the transaction is committed.


But I see your problem as

Quote:
•If the TimeoutNotification node has already propagated the message to the Catch terminal and an exception is thrown in the flow connected to the Catch terminal, the message is returned to the TimeoutNotification node. The TimeoutNotification node writes the error to the local error log and tries to process the message again.


ad infinitum. Maybe in your catch terminal flow you need to cancel the timeout request. Will that work?
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
misun
PostPosted: Tue Dec 07, 2010 5:02 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2010
Posts: 6

I've tried modifying the OutputLocalEnvironment's request and set it to CANCEL right before the flow Throw. If I view the message in debug mode between TimeoutNotification and the first node, the message is as it was originally.

I came to think of new possible scenario though.

Is there a way to delete the uncommitted messages written into the output within the flow's exception handling?

MQGet wouldn't work cause it's uncommitted. Any other ways...?
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 » TimeoutNotification and Throw to rollback transaction
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.