Author |
Message
|
ein |
Posted: Thu Dec 30, 2010 2:52 am Post subject: Question On WMB |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
Hi Guys,
I have question and confusion.
I designed a flow like
MQInput----> Compute ---- MQOutput ---> Database to update.
My requirement is ,In case database fails , the the message should roll bak.
But the problem i ma facing is , The messag is getting roll back as well as the message has placed In Q[Mqoutput Node]. I need to avoid this .
So i changed MQoutput node properties transcion mode as No.
But no use.
Can any one tell me what i missed . Or do i need any Q properties.
Thanks All You guys in advance. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 30, 2010 2:58 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Normally you don't want the output message to be committed if the transaction rolls back.
If you do, then set the transaction mode on the MQoutput node to No. |
|
Back to top |
|
 |
ein |
Posted: Thu Dec 30, 2010 2:59 am Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
Hi Zpat,
I did the same , But no use. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 30, 2010 3:23 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
OK, so the flow has failed before it reached the MQOutput node.
You have to connect the MQoutput via a try-catch terminal, so that it is executed even if an error has occured in the compute node.
Or handle the error in the compute node so it doesn't rollback. |
|
Back to top |
|
 |
ein |
Posted: Thu Dec 30, 2010 3:44 am Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
This is My flow Zpat,
Mqinput ------> Compute Node ----> MqOutput Node -----> Database to update my transaction status.
1. MqInput receives a message and it sends to Compute node to perform the operations. And the catch terminal of the Mqinput node is connected to
My error handling flow.
2.Compute node send the information to MQoutptunode .
3. MQoutput node out terminal is connected to my DB flow which will update transaction status.
Properties:Transaction Mode : No.
Persistence : Yes
My problem is. My DB flows due to some error. so the Message flow should not commit.
But i am not sure , My flow is putting the message in Q[MQoutput]. even failures of DB. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 30, 2010 3:56 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Do you want it to produce the message or not in this case?
Try using the debugger to see what the flow of control is. |
|
Back to top |
|
 |
ein |
Posted: Thu Dec 30, 2010 3:59 am Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
yes .
I don't want a produce a message. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 30, 2010 4:39 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Then set transaction mode to Yes, or automatic on MQOutput. |
|
Back to top |
|
 |
ein |
Posted: Thu Dec 30, 2010 8:00 am Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
I tried this options also,
But no use. still the message in Q. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 30, 2010 8:52 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Is the input message persistent or non-persistent?
Transaction mode Auto means transactional mode = Yes for Persistent and No for non-persistent. |
|
Back to top |
|
 |
optimist |
Posted: Fri Dec 31, 2010 5:54 am Post subject: Works as designed... |
|
|
Apprentice
Joined: 18 Nov 2010 Posts: 33
|
Your message flow works as designed.
Once you commit a message on to a Queue (MQOutout Node), the transaction scope ends. So, the flow that picks up the message from the queue (which it can only do so if the message on to the queue was committed & not under syncpoint) cannot be part of the original transaction. The behavior you see is per design of MQ.
In general, one uses the flow you have for near real-time updates where the downstream application (a database in your case) may or may not be available AND you'll want to perform the updates when the application comes back online.
You have a slighlty different use case here. Assuming you still need a message on the MQOutput queue for a successful database update, you will have to change your flow to perform the db update within your ESQL (or by invoking your flow that updates the db) before putting a message on the output queue.
HTH.
--optimist |
|
Back to top |
|
 |
|