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

Home -> Community -> Usenet -> c.d.o.server -> Re: jdbc failover to standby question

Re: jdbc failover to standby question

From: Joe Weinstein <joeNOSPAM_at_bea.com>
Date: Wed, 05 May 2004 12:19:45 -0700
Message-ID: <40993E51.5080703@bea.com>


Sue wrote:

> I'm having a problem understanding how TAF to a standby database in
> jdbc would work. I currently have a production database with a
> standby database. I understand that I need to set some failover
> settings in the tnsnames.ora file and use the thick java jar files.
> What I don't understand is exactly how this would work.
>
> Suppose I have database on machine A and standby on machine B with TAF
> set up in the tnsnames files on both machines. Now suppose I have a
> jdbc app running on machine C. If machine A fails, how does my jdbc
> app access the tnsnames failover information? How does it know to go
> to machine C? Does this only work if machine A stays up with the
> listener running? Can anybody shed some light on how this works?
>
> Sue

Hi Sue. Beware of JDBC and TAF. There are limitations to TAF that affect JDBC. Neither XA transactions nor any package execution will survive 'transparent' failover so any prepared statements that are either cached or in use calling packaged procedures will fail and have to be replaced.

    Failover happens differently depending on whether you use the thin or OCI-based driver, but neither will avoid some serious limitations with ongoing jdbc clients. Essentially the driver finds out that the DBMS it was talking to has died. This could be by the TCP layer telling the driver that the last call to get query results resulted in an EOF on the socket. At this point the driver will reconnect to the alternate DBMS, as specified in the URL or TDSNAMES.ORA file etc. At the time of the failure we hope the alternate DBMS is ready to take up the new work.

    When the new DBMS is contacted, it will do some work to rerun any ongoing query that was interrupted so the user's query can be resumed where it was, etc. Non XA transactional context is preserved, but XA conext is lost, and depending on what your JDBC was doing, some computational context such as package execution and their prepared statements is lost. As far as JDBC is concerned, TAF is OK for read-only clients.

Joe Weinstein at BEA Received on Wed May 05 2004 - 14:19:45 CDT

Original text of this message

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