Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Error for OCILogon2()

Re: Error for OCILogon2()

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 18 Aug 2003 01:46:04 -0700
Message-ID: <1a75df45.0308180046.7020095f@posting.google.com>


"Matt" <m_at_m.net> wrote
>
> Oracle 9.2.0.3, RH Linux 7.2.
> My oci applicetion creates a connection pool at startup, then use
> OCILogon2() to get a session. I'm trying to check OCILogon2()'s error to
> determine if a logon failure caused by the database server (down/stoped,
> network,..), then restart the appl to recreat the pool. I'm not sure about
> following errors on my hand, anymore errors apply to this scenario?
> ORA-00107 failed to connect to ORACLE listener process
> ORA-00130 invalid listener address 'string'
> ORA-00132 syntax error or unresolved network name 'string'

A few immediately comes to mind Matt:
ORA-12543: TNS:destination host unreachable ORA-12545: Connect failed because target host or object does not exist

But there's a lot more. If the OCILogon2() function fails, I would think that the assumption is that the db/network is no longer available (assuming valid username & password). Or do you find other errors?

BTW, the error numbers you give above does not resolve this side using oerr.

Let's say you do get what you do think is a comprehensive list of errors, but you miss a few. What then?

IMO it is not the greatest of ideas to try and determine the type of exception in order to programatically attempt to fix it. If a logon fails and it is not due an invallid username/password, that in my mind is a fatal error. Period.

What if the app bounces itself and attempt to re-create the connection pool and fails again? Who is to say that the problem is on the server side? It could be on the app side. Maybe someone went 'ifdown eth0' on that app platform. Or pulled a network cable. Or changes the TNSNAMES.ORA and screwed that up.

One of the assumptions that an app *must* make is that in case of an error, *it* is at fault. In fact, this is the number #1 assumption when coding apps that monitor services or servers.

--
Billy
Received on Mon Aug 18 2003 - 03:46:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US