Failover option @ jdbc for Dataguard || jdbc connects to wrong DB
803768Oct 27 2012 — edited Dec 17 2012hi forum,
I'm trying to understand why jdbc tries to connect to the standby DB, instead of the primary. My jdbc connection is configured like below:
connection-url="jdbc:oracle:thin:@(DESCRIPTION =
(LOAD_BALANCE = no)(FAILOVER = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = tstdg1)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = tstdg))
(ADDRESS = (PROTOCOL = TCP)(HOST = tstdg2)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = tstdg_stby))
(FAILOVER_MODE = (type = select)(method = preconnect)(retries = 180)(delay = 10)))"
tstdg1 is the primary DB, whereas tstdg2 is the Dataguard physical standby.
The problem is that jdbc connects to the standby DB instead of the primary one. Is there any option which I can configure to jdbc let always connect to the primary DB first? And only after the primary DB isn't accessible, jdbc should use the standby DB?
thx in advance