Limitations and Notes
Fast Connection Failover allows the UCP to quickly terminate connections to a failed database instance however it does not automatically resubmit the original query which forces the client to deal with the SQLException. This limitation requires that applications deal with the exception in a graceful manner or deliver the error to the user. There are some third party solutions such as Spring Source's Enterprise package which provide data source wrappers that handle the node failure exception and automatically resubmit the last query to the next node. These solutions may be worthwhile if a transient error for a user in a transaction is unacceptable in the event of a RAC node failure.
The UCP documentation states that it is compatible with both 10g and 11g Oracle drivers as well as third party drivers (assuming you don't want FCF support). However with FCF enabled, there appears to be a JVM security violation when deployed in Tomcat. Therefore it is recommended that you use the latest 11g driver with UCP if possible.
It is important to note that the discussion so far has been about the Oracle thin JDBC driver. This driver is usually preferred by application developers because it is cross platform and has no external dependencies. However some applications require the high-performance, native C-language based Oracle Call Interface (OCI) driver. This driver is compatible with FCF and can alternatively use Transparent Application Failover (TAF) which operates at a lower level than FCF and can automatically resubmit SELECT queries in the event of a node failure. However for most applications, the ease of deployment of the thin driver with full FCF support will outweigh any benefits offered by the OCI driver.
Highly Available JDBC
Oracle RAC is a great foundation for an HA architecture and with the new Universal Connection Pool features, Java clients can immediately take advantage of RAC with only simple data source configuration changes. In this article you saw how to configure the key components of RAC on the server side, test the configuration from the client side, and configured Tomcat and Spring to leverage the RAC features. Oracle has done an excellent job of writing lightweight, JDBC drivers that make it an excellent choice for large scale Java applications. Give RAC a try and hit your five 9s of uptime with your current applications.
- Oracle 11g Release 2 JDBC Drivers
- Oracle 10g Release 2 ONS Library (10.2.0.3)
- Oracle 11g Release 2 UCP Library
- Oracle 11g Release 2 Real Application Clusters Administration and Deployment Guide
- Oracle 11g Release 2 JDBC Developer's Guide
- Oracle 11g Release 2 Universal Connection Pool for JDBC Developer's Guide