|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to catch Oracle error in a message flow |
« View previous topic :: View next topic » |
Author |
Message
|
Jinghui |
Posted: Tue Mar 01, 2005 7:38 pm Post subject: How to catch Oracle error in a message flow |
|
|
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 |
|
 |
JT |
Posted: Tue Mar 01, 2005 8:40 pm Post subject: |
|
|
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 |
|
 |
csongebalazs |
Posted: Wed Mar 02, 2005 2:40 am Post subject: |
|
|
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 |
|
 |
Jinghui |
Posted: Wed Mar 02, 2005 10:26 am Post subject: Thanks you guys! I will try that! |
|
|
Newbie
Joined: 01 Mar 2005 Posts: 2
|
|
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
|
|
|
|