FAQ: JDBC Drivers and Failover Mechanisms (FCF, TAF, SCAN) (Doc ID 1080674.1)

To BottomTo Bottom

In this Document

  Purpose
  Questions and Answers
  What are the different types of failover mechanisms available ?
  Can I use FCF and TAF together ?
  Is FCF provided by Oracle JDBC 9i drivers ?
  We have been told by Oracle that FCF is not available when using XA JDBC drivers.  What HA options are available to us should we wish to use XA?
  How do we configure SOA Suite (a simple EE5 application) so that planned and unplanned outages have no impact on applications and that transactions are transparently failed over?
  Are there any special database setup configurations that we need to take into consideration when using XA and HA together?
  How do we write EE5 code that makes use of SessionBeans, EntityBeans and PersistentManager so that we can provide HA.  I have seen examples of FCF and JDBC code that issues a retry when receiving a SQLException.  When using EE5 you do not write your code to use JDBC.  What options are available to us? 
  What is SCAN ?  Which version of JDBC supports SCAN ?
  References

 

APPLIES TO: 

JDBC - Version 11.2.0.1.0 and later
Universal Connection Pool - Version 11.1.0.7.0 and later
Information in this document applies to any platform.

PURPOSE

Answers to common questions on failover using Oracle JDBC driver 
 

This FAQ covers only Java programs (clients) connecting via JDBC driver. This does not cover failover with other clients such as SQL*Plus, etc.

QUESTIONS AND ANSWERS

 

What are the different types of failover mechanisms available ?

JDBC-THIN driver supports Fast Connection Failover (FCF)
JDBC-OCI driver supports Transparent Application Failover (TAF)
JDBC-THIN 11gR2 supports Single Client Access Name (SCAN)

 

Can I use FCF and TAF together ?

No. Only one of them should be used at a time.

 

Is FCF provided by Oracle JDBC 9i drivers ?

No. FCF is built on the pooling feature known as 'Implicit Connection Caching' and this is available only with JDBC 10g or higher versions.
Please also note that in version 11gR2 the FCF is now deprecated along with the Implicit Connection Caching in favor of using the Universal Connection Pool (UCP)

 

We have been told by Oracle that FCF is not available when using XA JDBC drivers.  What HA options are available to us should we wish to use XA?

In 10g JDBC, the driver-embedded connection pool (ICC) cannot pool XA connections i.e., XAConnection objects.  FCF only works for cached connections from OracleDataSource.
As a workaround, you can use Universal Connection Pool (UCP) the new connection pool, which supports pooling XA connections, on top of 11g JDBC.  And this works against both 11g and 10g database.

 

Additional Reading:

 

How do we configure SOA Suite (a simple EE5 application) so that planned and unplanned outages have no impact on applications and that transactions are transparently failed over?

For Planned Outages:
=================

FCF DOES NOT SUPPORT PLANNED OUTAGES LIKE SERVICE RELOCATION (Doc ID 1076130.1)  

Fast Connection Failover does not support planned outages like a service relocation. It is designed to work for unplanned outages, where a RAC service is preferred on all the nodes in the cluster and one of the nodes goes down unexpectedly.  When a planned outage like a service relocation is done from one node to the other,  FCF does not work as expected and the result is unpredictable.
There is no solution at present for this.  Enhancement request 9495973 has been raised to address this limitation 

For Un-Planned Outages:
====================

See following documentation:

 

Are there any special database setup configurations that we need to take into consideration when using XA and HA together?

In general, when doing XA with a RAC database, you need to use affinity to control on which node you're connected to. In short, you want to ensure that given a global transaction, all the work goes to a single database instance.

You can refer to this old but still interesting Technical Brief:
http://www.oracle.com/technetwork/database/enterprise-edition/bestpracticesforxaandrac-128676.pdf

To add to the above information, it should be noted that starting in RDBMS 11gR1, transaction branches can go to different instances even though there could be a potential performance cost (for row locking synchronization, etc.). Before 11gR1, all transaction branches had to the same instance.

 

How do we write EE5 code that makes use of SessionBeans, EntityBeans and PersistentManager so that we can provide HA.  I have seen examples of FCF and JDBC code that issues a retry when receiving a SQLException.  When using EE5 you do not write your code to use JDBC.  What options are available to us? 

It is up to the J2EE container or the servlet implementor to retry when an exception occurs. This is not done in the JDBC-THIN driver (FCF).
Note:  There is no retry done by Oracle Application Server 10.1.3.x or any of the other versions.  It is currently under consideration for implementation in a future release.

 

What is SCAN ?  Which version of JDBC supports SCAN ?

SCAN or Single Client Access Name is a new Oracle Real Application Clusters (RAC) 11g Release 2 feature that provides a single name for clients to access an Oracle Database running in a cluster. The benefit is clients using SCAN do not need to change if you add or remove nodes in the cluster.  Having a single name to access the cluster allows clients to use the EZConnect client and the simple JDBC thin URL to access any database running in the clusters independently of which server(s) in the cluster the database is active. SCAN provides load balancing and failover of client connections to the database. The SCAN works as an IP alias for the cluster.

A typical JDBC URL using SCAN would look like:

jdbc:oracle:thin:@sales1-scan:1521/oltp

Additional Reading:

http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf

SCAN feature is supported only from JDBC version 11.2.0.1.  This was one of the features added to 11.2 as a part of "IPv6 support".

 


Join the Java Development MOS Community forum for general discussions, questions, best practices, and other valuable information on: Oracle JDeveloper and ADF, Oracle WebLogic - JEE Programming (EJB, JMS etc), Oracle JDBC, Oracle Web Services (incl. DBWS Callout Utility), Oracle Web Services Manager (OWSM), Oracle Service Registry (OSR), Oracle Toplink (EclipseLink), Sun NetBeans IDE / Java Studio Creator & Java Studio Enterprise, OC4J, KODO.