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 doesn't work for Java clients, but works for SQL Plus

Re: Failover doesn't work for Java clients, but works for SQL Plus

From: Andreas Sheriff <spamcontrol_at_iion.com>
Date: Tue, 13 Jun 2006 10:28:06 -0700
Message-ID: <VBCjg.13366$KB.1218@fed1read08>


"DA Morgan" <damorgan_at_psoug.org> wrote in message news:1150216249.325813_at_bubbleator.drizzle.com...

> 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 =
>> ) ) )
>>
>> 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.org

I'm sorry.

My bad.
I forgot to mention that I was tunneling through SSH to the vip from localhost:1522-> vip1:1521 and localhost:1523->vip2:1521

SQLPlus uses failover, PHP uses failover, but Java does not. And it doesn't matter whether I'm tunneling or connecting from inside the network.

The connections load balance well, but gv$session shows that failover is not active.

Thanks,

-- 
Andreas
Oracle 9i Certified Professional
Oracle 10g Certified Professional
Oracle 9i Certified PL/SQL Developer


"If you don't eat your meat, you cannot have any pudding.
"How can you have any pudding if you don't eat your meat?!?!"
---

WARNING:
DO NOT REPLY TO THIS EMAIL
Reply to me only on this newsgroup 
Received on Tue Jun 13 2006 - 12:28:06 CDT

Original text of this message

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