Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Failover doesn't work for Java clients, but works for SQL Plus
Andreas Sheriff wrote:
> Oracle 10.2.0.2.0
> RHEL4
> 2 Node rac
>
> I can't seem to get failover to work for Java clients using jdbc:thin
> (term?).
> I'm usinig the connect descriptor:
>
> (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT =
> 1522)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1523))
> (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED)
> (SERVICE_NAME = test.test.com) (FAILOVER_MODE = (TYPE = SELECT)
> (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) )
>
> Which is the same descriptor that I'm using in SQL*Plus:
>
> test.test.com =
> (DESCRIPTION =
> (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
> (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1523))
> (LOAD_BALANCE = yes)
> (CONNECT_DATA =
> (SERVER = DEDICATED)
> (SERVICE_NAME = test.test.com)
> (FAILOVER_MODE =
> (TYPE = SELECT)
> (METHOD = BASIC)
> (RETRIES = 180)
> (DELAY = 5)
> )
> )
> )
>
> SQL*Plus connects with failover, but Java does not. The manual states that
> the thin interface should be able to connect if you use the whole descriptor
> while connecting, but that doesn't seem to work.
>
> Has anyone else experienced that and have come up with a solution?
>
> Please don't tell me I have to use this crazy syntax:
>
> http://download-west.oracle.com/docs/cd/B19306_01/rac.102/b14197/hafeats.htm#sthref453
You are connecting to the server, LOCALHOST, not the service. Look at this TNSNAMES entry for comparison.
TSTCD =
(DESCRIPTION =
(ADDRESS=(PROTOCOL = TCP)(HOST = vipgamma1.psoug.org)(PORT = 1521)) (ADDRESS=(PROTOCOL = TCP)(HOST = vipgamma2.psoug.org)(PORT = 1521)) (ADDRESS=(PROTOCOL = TCP)(HOST = vipgamma3.psoug.org)(PORT = 1521)) (ADDRESS=(PROTOCOL = TCP)(HOST = vipgamma4.psoug.org)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TSTC) )
Note the connection is to the VIP.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Jun 13 2006 - 11:30:44 CDT