|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
THROW statement |
« View previous topic :: View next topic » |
Author |
Message
|
Nyusser |
Posted: Wed Sep 04, 2002 12:59 am Post subject: THROW statement |
|
|
Apprentice
Joined: 02 Jul 2002 Posts: 48
|
Hi,
If I use THROW statement in compute node, will it always be the input message (roll-back) that is propagated to the failure terminal of the node? |
|
Back to top |
|
 |
kirani |
Posted: Wed Sep 04, 2002 8:11 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Yes, the message input to this compute node will be propagated thru the failure terminal. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Nyusser |
Posted: Thu Sep 05, 2002 1:16 am Post subject: |
|
|
Apprentice
Joined: 02 Jul 2002 Posts: 48
|
Thanks.  |
|
Back to top |
|
 |
ernest-ter.kuile |
Posted: Fri Sep 06, 2002 4:32 am Post subject: Re: THROW statement |
|
|
 Apprentice
Joined: 13 May 2002 Posts: 49 Location: KLM Holland
|
Nyusser wrote: |
Hi,
If I use THROW statement in compute node, will it always be the input message (roll-back) that is propagated to the failure terminal of the node? |
Sorry if I miss understood, but after a THROW a message will *not* leave by the faillure terminal of the compute node. The failure terminal of the compute node is only used if you happen to do a RETURN False; as an ESQL statement.
After a THROW, a message will roll-back to the state it had at the last try-catch capable node (a copy of the input message is done there for this very purpose).
usually this will be at the MQInput node.
All intermediate handeling of the message by any other mean will be undone, and not just whatever happened in the compute node where the THROW was done. |
|
Back to top |
|
 |
kirani |
Posted: Fri Sep 06, 2002 1:25 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
ernest-ter.kuile wrote: |
.... but after a THROW a message will *not* leave by the faillure terminal of the compute node....
|
I disagree! I think, if you have failure terminal connected, then the message will propagate thru failure terminal of the Compute node.
Without the THROW statement, if there is an error in a Compute node at runtime, and if you have failure terminal connected, message will propagate thru it. This means you don't need return FALSE; in your compute node to propagate failed message to failure terminal. By adding THROW statement things don't change much, so message should go to failure terminal.
Let's test this  _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
ernest-ter.kuile |
Posted: Mon Sep 09, 2002 2:19 am Post subject: |
|
|
 Apprentice
Joined: 13 May 2002 Posts: 49 Location: KLM Holland
|
This is not what I would expect from a try/catch/exception handling system. And, although I haven't explicitly tried this, what seems to happen in our environment is that exceptions propagate back to the previous catch terminal and get handled there.
Hmmm, I have to check this.
kirani wrote: |
Let's test this :) |
I will not be able to test this this week. But if you do, I would be very happy to hear about this. |
|
Back to top |
|
 |
kwelch |
Posted: Thu Sep 12, 2002 6:23 am Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
If I understand the situation correctly, I agree with Kirani and we have tested this situation.
We have a messageflow where on the input node the catch is wired to a throw, the fail is wired to a failure queue and the out goes to the compute node. If the compute node fails, it goes to the throw which passes back the original message then goes to the fail and writes to the fail queue. We don't code any return FALSE statements.
Is this what you were talking about?
Karen |
|
Back to top |
|
 |
ernest-ter.kuile |
Posted: Thu Sep 12, 2002 11:57 pm Post subject: |
|
|
 Apprentice
Joined: 13 May 2002 Posts: 49 Location: KLM Holland
|
kwelch wrote: |
If I understand the situation correctly, I agree with Kirani and we have tested this situation.
We have a messageflow where on the input node the catch is wired to a throw, the fail is wired to a failure queue and the out goes to the compute node. If the compute node fails, it goes to the throw which passes back the original message then goes to the fail and writes to the fail queue. We don't code any return FALSE statements.
Is this what you were talking about?
Karen |
this is actually what I thought it should do, so if Kirani meant this too, then maybe the confusion comes from the fact that the compute node also has a failure terminal, and from the fact that a throw is an ESQL statement as wel as a node.
When doing a return false; in a compute node, the message, in it's current state will exit the failure terminal of the compute node. If nothing is wire to that terminal, the message is droped.
when doing a throw ESQL statement (not wiring anything to a throw node) in the compute node, the original message is propagated back to the catch terminal of the previous try-catch capable node (e.g. an MQInput node) where it will initially exit the catch terminal.
lastly, Karen, when wiring a throw node to the catch terminal (of the MQInput node) you are actually throwing an exception while handling one.
- For one thing this actually very bad form.
- This is most probably not necessary as the message coming out of the catch terminal is already in the original form.
- I agree this would probably re-propagate your exception to the failure terminal (actually, you demonstrated it would).
Cheers,
Ernest. |
|
Back to top |
|
 |
ernest-ter.kuile |
Posted: Tue Sep 17, 2002 2:11 am Post subject: Throwing exceptions and the failure terminal of compute node |
|
|
 Apprentice
Joined: 13 May 2002 Posts: 49 Location: KLM Holland
|
kirani wrote: |
ernest-ter.kuile wrote: |
.... but after a THROW a message will *not* leave by the faillure terminal of the compute node....
|
I disagree! I think, if you have failure terminal connected, then the message will propagate thru failure terminal of the Compute node.
Without the THROW statement, if there is an error in a Compute node at runtime, and if you have failure terminal connected, message will propagate thru it. This means you don't need return FALSE; in your compute node to propagate failed message to failure terminal. By adding THROW statement things don't change much, so message should go to failure terminal.
Let's test this :) |
Well Kirani, I did, and you were right. This is most odd (not that you are right, but that this is indeed happening), but throwing an exception (using the THROW statement) in a compute node causes the current message to be send out of the failure terminal of that compute node if it's connected to anything.
The catch terminal is used only if the failure terminal of the compute node isn't connected.
Note however the above this is NOT true if instead of THROWing an exception inside the compute node, the out terminal is wired to a THROW node. The THROW node really will propagate (as expected) to the nearest previous catch terminal.
Thus to THROW an exception using a statement and to THROW an exception using a node will have different results.
I thought I had tested this, however I must have been blinded by my expectations.
Further more I consider this a bug (feature?) |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|