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 » Retry Database errors

Post new topic  Reply to topic
 Retry Database errors « View previous topic :: View next topic » 
Author Message
KIT_INC
PostPosted: Fri Aug 03, 2007 12:47 pm    Post subject: Retry Database errors Reply with quote

Knight

Joined: 25 Aug 2006
Posts: 589

We have an unstable database server environment for our WMB developers. The server is shared by other test group and can be stopped from time to time. We like to retry our flow when we detect certain ODBC errors. So we uncheck the box "Throw exception on database errors" in the compute node and use ESQL to check the SQLNAtiveError. Then we decide on what to do base on the code returned by SQLNAtiveError.
However we found that the broker will throw an exception if the database connection is not available (e.g. ODBC return code '-1'). Debug of the flow show that we have not even entered the compute node. I understand that broker will try to connect and re-use connections. Is that the reason why an exception is throw even I have unchecked "Throw exception on database errors"?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Aug 03, 2007 4:15 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

In general (at least, as far as I know) it's not possible to know if a given ODBC database connection is invalid without actually trying to use it.

Therefore, in general, one should code applications that use ODBC to expect that a connection might fail.

In Broker, the easiest way to do this is to use Backout processing, and allow messages to be tried once or twice before being moved to a backout queue.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
dkeister
PostPosted: Mon Aug 06, 2007 7:04 am    Post subject: Reply with quote

Disciple

Joined: 25 Mar 2002
Posts: 184
Location: Purchase, New York

I had this problem but had to implement a database retry. In my case I wanted to retry:

SQL 3113 = EOF on communication channel (among many)
SQL 3114 = not connected to ORACLE
SQL 12571 = TNS packet writer failure

and notify someone if there is a different error or if retry fails.

Basically, I set a retry count in the node before the compute node I use to access the database. Then in the basic properties of the node accessing the database, I uncheck the 'Throw exception on database error'.

In ESQL of the compute node, if there is an SQL error, I capture the SQL error information and Throw a user exception.

In a Filter node attached to the Failure terminal, I check to see if the error is the retryable DB error, if so, I decrement the retry count and reexecute the compute node. If not, I continue to my error handling node.

This allows my flow to retry certain recoverable errors and if recovery is successful, normal processing continues. If the error is not recoverable, my error node sends an email with the specific conditions to tell people exactly what the error was.

This has saved a lot of time and finger pointing as the people first responding to the problem don't know what is going on.

I can send sample code if you are interested.

(I couldn't rely on the Backout processing Jeff suggested because of a variety of non-technical reasons.)
_________________
Dean Keister
Back to top
View user's profile Send private message Send e-mail Visit poster's website
EddieA
PostPosted: Mon Aug 06, 2007 11:15 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

There is a RedPaper WebSphere Message Broker V6, Best Practices Guide: Bullet Proofing Message Flows that includes a section on handling DB Recovery.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
dkeister
PostPosted: Mon Aug 06, 2007 12:10 pm    Post subject: Reply with quote

Disciple

Joined: 25 Mar 2002
Posts: 184
Location: Purchase, New York

Thanks Eddie. oops, forgot about that. I wrote it. Let me know if there are any questions.
_________________
Dean Keister
Back to top
View user's profile Send private message Send e-mail 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 » Retry Database errors
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.