Fast Connection Fail-over (FCF) is an extension of the Oracle JDBC
Implicit Connection Cache, to RAC. It work in conjunction with RAC
events and Oracle's Notification System (ONS).
In order for Commons db pooling to support RAC similar to FCF, it must
subscribe to RAC events notification and process the events in
questions.
If the Oracle documentation is not enough, you can find more details
(including code fragment) in my book
http://www.amazon.com/gp/product/1555583296/
Kuassi, http://db360.blogspot.com/
jimc - 18 May 2006 13:23 GMT
That's pretty much what I thought too.
So the real question is whether the commons pooling does this. Does
anybody know the answer to that?
kuassi.mensah@gmail.com - 18 May 2006 17:24 GMT
Hi,
Being product manager for the Oracle JDBC (among other
responsibilities), i cannot speak for Apache Commons dbcp but i am
certain than no other driver and connection pool than Oracle does this,
currently.
"jimc" <jimcross@jimcross.com> said:
>Does anybody know if the commons db pooling will work out of the box
>with Oracle RAC?
>
>It seems that the connection string will be different; however, some
>Oracle documentation says that for Fast Connection Failover to work the
>implicit connection cache must be enabled.
After reading through the other responses so far, I guess that the needed
support is not in the commons db pooling.
I've written (but unfortunately cannot share) a piece of code that
enables direct use of Oracle JDBC in Tomcat, including parametrization
for implicit connection cache. Actually it wasn't too hard to get the
two ends to meet.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
kuassi.mensah@gmail.com - 19 May 2006 21:32 GMT
Using Oracle JDBC connection caching with Tomcat should not be
different than using it with a stand-alone Java/JDBC code.
In summary:
a)create an Oracle data source
OracleDataSource ods = new OracleDataSource();
b) set the DataSource property ConnectionCachingEnabled to true
ods.setConnectionCachingEnabled(True);
c) optionally set more properties (see the Oracle JDBC doc for more
details @
http://www.oracle.com/pls/db102/to_pdf?pathname=java.102%2Fb14355.pdf&remark=por
tal+%28Application+development%29
)
ods.setConnectionCacheName("MyCache"); // optional
ods.setConnectionCacheProperties(cp); // optional
d) getConnection() will service connection requests from the cache (you
may pre-populate the cache with minimal number of connections,
otherwise the first connection requests will trigger connection
creation).
conn = ods.getConnection();
For Fast Connection Failover in RAC environments using 10g JDBC:
1) you need to configure ONS so that JDBC can subscribe to RAC events
and be notified upon node/instance/service failure or the addition of
new instance.
2) Then, enable FastConnectionFailover either programmatically
ods.setFastConnectionFailoverEnabled(true);
or using system property: java -D
oracle.jdbc.FastConnectionFailover=true
3) catch fatal SQLEXception (and retry if so). fata SQLException is a
list of SQL exceptions related to node/instance/service/network down
(user can programmatically add it's own exceptions)
See codes samples @
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g
/index.html
See also complete step by step instructions in chapter 7 of my book @
http://www.amazon.com/gp/product/1555583296/
Kuassi, http://db360.blogspot.com/
Juha Laiho - 20 May 2006 09:51 GMT
"kuassi.mensah@gmail.com" <kuassi.mensah@gmail.com> said:
>Using Oracle JDBC connection caching with Tomcat should not be
>different than using it with a stand-alone Java/JDBC code.
Ah, yes; I didn't write clearly enough.
The target was to keep the actual application code db-agnostic,
and write a JNDI provider for Tomcat so that application uses
the regular J2EE mechanisms for getting connections, and Tomcat
handles pooling etc independently of the application.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)