symbolic ORA-XXXX names and classes of such

From: <mh_at_pixar.com>
Date: Sun, 07 Jun 2009 05:43:20 GMT
Message-ID: <YrIWl.8897$Lr6.2725_at_flpi143.ffdc.sbc.com>



I'm adding code to my application to make it TAF-aware. TAF an excellent feature and I haven't had much problem getting the extra error checking in place.
  1. Is there some place where symbolic names for the ORA-XXXXX codes are defined?
  2. Is there some grouping or categorizing, such as "this is the set of all ORA errors you can get on a connect and that would benefit from a retry".

My code currently looks as per below, and I would like to be able to remove a bit of the hardcoded numbers. I've built up these numbers by trial and error.

Many TIA!
Mark

    # connect to the database, and retry on fixable exceptions     try:

        conn=cx_Oracle.connect(connstr)
    except cx_Oracle.DatabaseError,e:

# ORA-01033: ORACLE initialization or shutdown in progress
# ORA-12537: TNS:connection closed
# ORA-12528: TNS:listener: all appropriate instances are blocking
# new connections
# ORA-12521: TNS:listener does not currently know of instance
# requested in connect descriptor
# ORA-12520: TNS:listener could not find available handler for
# requested type of server

        if e.message.code in [1033,12537,12528,12521,12520]:
            print 'RETRYING:', e.message.message.strip()
            ...
-- 
Mark Harrison
Pixar Animation Studios
Received on Sun Jun 07 2009 - 00:43:20 CDT

Original text of this message