|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Accessing SQLSTATE through WMB 6.0 |
« View previous topic :: View next topic » |
Author |
Message
|
santy |
Posted: Tue Jul 28, 2009 4:41 am Post subject: Accessing SQLSTATE through WMB 6.0 |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi,
I have developed a flow which has compute node Data Source property set to point to some external database.
When the Database listener is running, the code written for SQLSTATE handling works fine.
But when the DB listener goes down, the code fails because it tries to connect to DB with the Data Source Property mentioned in compute node.
with following error - '[DataDirect][ODBC Oracle driver][Oracle]ORA-12505: TNS:listener could not resolve SID given in
connect descriptor '
I checked through usertace, the code fails when it gets the compute node itself and it does not execute the code written in compute node.
So should we not write code to check for SQLSTATE in compute node if such problems occours or is there any other way to handle such situations? |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Jul 28, 2009 5:50 am Post subject: Re: Accessing SQLSTATE through WMB 6.0 |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
santy wrote: |
is there any other way to handle such situations? |
Try/catch node before the compute that then interrogates the exception list to determine what went wrong and then rethrows the exception if needed? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jul 28, 2009 9:27 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you are doing the DB updates via ESQL in a Compute node, you can turn off the automatic throwing of exceptions in that node.
Then you can get at the SQLCODE, SQLSTATE etc in your ESQL and handle the error appropriately.
something like
Code: |
INSERT INTO .....
if SQLSTATE <> 0 then
-- check for certain types of error here
-- but there may be more than one error code for some situations
--
if error_is_fatal
throw;
end if;
end if;
|
As my comment above suggests, there could be more than one value for SQLERROR returns in situations like a DB disconnect.
If I recall, for SQL Server 2000, we gave up trying to code for this after 15 different error numbers were recorded.
Personally, if the connection to the DB goes away, then there is something fundamental wrong with your network and/or Database which should be triggering alarms elsewhere. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
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
|
|
|
|