Channels ▼

JVM Languages

JDBC Fast Connection Failover with Oracle RAC

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.


Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.