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 » How to catch Oracle error in a message flow

Post new topic  Reply to topic
 How to catch Oracle error in a message flow « View previous topic :: View next topic » 
Author Message
Jinghui
PostPosted: Tue Mar 01, 2005 7:38 pm    Post subject: How to catch Oracle error in a message flow Reply with quote

Newbie

Joined: 01 Mar 2005
Posts: 2

Hi,

I have a message flow that queries Oracle database. It's a simple query. It runs fine most of the time. However sometimes it will get an Oracle 'end-of-file' error, error code 3113. Nothing about the query is wrong. But the message ended up in failure queue because of this sporadic error. I tried to put a try/catch node around the compute node. But it didn't catch this error. Maybe my try/catch node is wrong. Can anyone show me how to create a try/catch node?

Also, is there a way to filter the exceptions to catch? Like in C++ and Java?

I will post my message flow chart and the code in compute node later.

Thanks,
J.
Back to top
View user's profile Send private message
JT
PostPosted: Tue Mar 01, 2005 8:40 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
Can anyone show me how to create a try/catch node?

An alternative is to detect the database error within the Compute node. Right-click the Compute node, and select Properties. Ensure the following two properties are unchecked.
  • Treat warnings as errors
  • Throw exception on database error
In the ESQL code, immediately following the SQL call, interrogate the variables SQLCODE & SQLNATIVEERROR. An example would be:
Code:

IF (SQLCODE <> 0) THEN
   IF  (SQLNATIVEERROR = 3113) THEN
      --  Rollback the transaction / Throw exception / Whatever  --
   END IF;
END IF;
Back to top
View user's profile Send private message
csongebalazs
PostPosted: Wed Mar 02, 2005 2:40 am    Post subject: Reply with quote

Voyager

Joined: 30 Jan 2004
Posts: 78

My "default" database error handling code is the following:

Code:
DECLARE sqlerror CHAR;
IF SQLCODE <> 0 THEN
   SET sqlerror = 'SQLState: ' || SQLSTATE || ' / SQLCode: ' || CAST(SQLCODE AS CHAR) || ' / SQL Native Error : ' || CAST(SQLNATIVEERROR AS CHAR) || ' / SQL Error Text: ' || SQLERRORTEXT;
   THROW USER EXCEPTION CATALOG 'WMQIv210' MESSAGE 2950 VALUES ('Error at Input message logging', sqlerror);
END IF;

Hi

Balazs
Back to top
View user's profile Send private message
Jinghui
PostPosted: Wed Mar 02, 2005 10:26 am    Post subject: Thanks you guys! I will try that! Reply with quote

Newbie

Joined: 01 Mar 2005
Posts: 2

Thanks.
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 » How to catch Oracle error in a message flow
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.