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: failover JDBC thin driver connection in 10.2 RAC

Re: failover JDBC thin driver connection in 10.2 RAC

From: <joeNOSPAM_at_BEA.com>
Date: 20 Aug 2006 11:39:07 -0700
Message-ID: <1156099147.144180.96510@75g2000cwc.googlegroups.com>

cbarak wrote:
> I have problem failing over JDBC (thin driver) connection using TAF:
>
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
> dhp1-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST =
> dhp2-vip)(PORT =1521)) (ADDRESS = (PROTOCOL = TCP)(HOST =
> dhp3-vip)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER =
> DEDICATED) (SERVICE_NAME = ypapps) (FAILOVER_MODE = (TYPE = SELECT)
> (METHOD = BASIC) (RETRIES = 180) (DELAY = 5))))","scott","tiger");
>
>
> >From the many threads I have read, some folks were able to use TAF for
> JDBC thin client connections in 10gr2. Are there any specific
> configuration I have to set up for JDBC thin client to make failover
> transparent?
>
> I have also read from Oracle manuals that Fast Connection Failover is
> the preferred method for jdbc connection. How do I turn on FCF - ie
> where do I set FastConnectionFailoverEnabled=true? For now, I'm just
> running a simple java program on one of the RAC nodes that connects to
> the database via jdbc thin driver and does a query on schema objects.
> Do I specify FastConnectionFailoverEnabled=true in some Oracle
> configuration file or in my .java program?
>
> Thanks.

Hi. I don't think TAF works with the thin driver. TAF promises automatic
in-flight failover, including transparent continuation of any ongoing queries, etc. and relies on OCI low-level features that the thin driver doesn't have. In any case TAF is poorly implemented as far as JDBC is concerned because the computational state does not fail over well enough to guarantee that prepared statements are still valid, and other complex stuff like XA transactions won't carry over. TAF is closest to reliable with read-only DBMS access. I will post a URL later to Oracle's
own documents listing the onerous failure possibilities with TAF which can make it worse than simply making a new connection.   Your URL is sufficient for the thin driver to do connection-level failover,
which means when the DBMS fails, you current connection will stay dead, but if you close it and make a new one, it will succeed in connecting
to the failover DBMS if the primary one is still dead.

Joe Weinstein at BEA Systems Received on Sun Aug 20 2006 - 13:39:07 CDT

Original text of this message

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