5. jose_luis_fdez_diaz_n...@yahoo.es Oct 5, 12:47 pm show options
From: jose_luis_fdez_diaz_n...@yahoo.es - Find messages by this author
Date: 5 Oct 2005 03:47:09 -0700
Local: Wed, Oct 5 2005 12:47 pm
Subject: Re: OCCI Connection Pool on Oracle RAC
Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse
Is it possible from OCCI program to use OCI's library failover callback
as show in the code below:
. . .
conn = env->createConnection (user, passwd, db);
. . .
OCIFocbkStruct failover; /* failover callback
/* allocate memory for context */
failover.fo_ctx = (dvoid *)malloc(strlen("my context."));
/* initialize the context. */
failover.callback_function = &callback_fn;
/* do the registration */
OCIAttrSet(conn->getOCIServer(), (ub4) OCI_HTYPE_SERVER,
(dvoid *) &failover, (ub4) 0,
(ub4) OCI_ATTR_FOCBK, errhp)
. . .
you can do it. But TAF callback registration has been added in 10.2 OCCI. Please see the documentation for more details
Thank you. This is just what I need.
I am using a Connection Pool. I guess that failover is transparent to the Pool. I mean, it is not necessary to recreate the pool (terminateConnectionPool, createConnectionPool).
Sorry, the above works only for normal connections and StatelessConnectionPool only, till 10.1.0.4. TAF does not work for Connection pools (in OCI and OCCI) till 10.1.0.4. It is supported only from 10.2 onwards. I hope that is clear.
For ConnectionPools, if the instance goes down and you get and exception, you can terminate that connection and try for a new one. The bad ones go off the pool as you terminate them and new good ones get created as you ask for more and all the bad ones have gone off the pool. You don't have to terminate the pool.
On RAC failover when I try to get a connection from the Pool, an exception is raised:
ORA-03113: end-of-file on communication channel
Then I try to terminate the Connection Pool, but the exception below is raised:
ORA-24397: error occured while trying to free connections
Why this expception is raised ?