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 » THROW statement

Post new topic  Reply to topic
 THROW statement « View previous topic :: View next topic » 
Author Message
Nyusser
PostPosted: Wed Sep 04, 2002 12:59 am    Post subject: THROW statement Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Wed Sep 04, 2002 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Nyusser
PostPosted: Thu Sep 05, 2002 1:16 am    Post subject: Reply with quote

Apprentice

Joined: 02 Jul 2002
Posts: 48

Thanks.
Back to top
View user's profile Send private message
ernest-ter.kuile
PostPosted: Fri Sep 06, 2002 4:32 am    Post subject: Re: THROW statement Reply with quote

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
View user's profile Send private message Visit poster's website
kirani
PostPosted: Fri Sep 06, 2002 1:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ernest-ter.kuile
PostPosted: Mon Sep 09, 2002 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Thu Sep 12, 2002 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ernest-ter.kuile
PostPosted: Thu Sep 12, 2002 11:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ernest-ter.kuile
PostPosted: Tue Sep 17, 2002 2:11 am    Post subject: Throwing exceptions and the failure terminal of compute node Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » THROW statement
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.