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 » Accessing SQLSTATE through WMB 6.0

Post new topic  Reply to topic
 Accessing SQLSTATE through WMB 6.0 « View previous topic :: View next topic » 
Author Message
santy
PostPosted: Tue Jul 28, 2009 4:41 am    Post subject: Accessing SQLSTATE through WMB 6.0 Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jul 28, 2009 5:50 am    Post subject: Re: Accessing SQLSTATE through WMB 6.0 Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 28, 2009 9:27 am    Post subject: Reply with quote

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
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 » Accessing SQLSTATE through WMB 6.0
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.