Announcement Announcement Module
Collapse
No announcement yet.
JNDI DataSources and Oracle RAC FCF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JNDI DataSources and Oracle RAC FCF

    I am interested in using the Oracle RAC and FCF support, but all the examples are predicated around the datasource being defined in the spring beans file via one one of the <orclooling-datasource > tag.

    However, when deploying in an application server, I would need to get the datasource itself from a JNDI resource, and wrap it up inside the appropriate proxy configuration to handle the RAC/FCF support.

    Are there any examples of doing this?

    PS: I would prefer a general, no container specific example, as we don't want to tie ourselves to a particular container (ie, tomcat, weblogic, etc....)

  • #2
    You would replace the <orclooling-datasource> with a regular jndi lookup configuration. Then on the appserver side you would need to configure a datasource that's capable of supporting FCF. So the example will be container specific. Here is an example for Tomcat (in server.xml):
    Code:
    <Resource name="jdbc/rac" auth="Container"
                  type="oracle.jdbc.pool.OracleDataSource"
                  description="Oracle Datasource"
                  factory="oracle.jdbc.pool.OracleDataSourceFactory"
                  url="jdbc:oracle:thin:@(description=(address_list=(address=(host=rac1)(protocol=tcp)(port=1521))(address=(host=rac2)(protocol=tcp)(port=1521))(load_balance=no))(connect_data=(service_name=racdb1)))"
                  user="pet"
                  password="clinic"
                  ONSConfiguration="nodes=rac1:6200,rac2:6200"
                  fastConnectionFailoverEnabled="true"
                  connectionCachingEnabled="true"
                  connectionCacheName="PETCLINIC"/>
    You would have to verify that it actually performs connection failover in your environment, but this is the basic configuration needed.

    Comment


    • #3
      You may also want to configure the connection pool size and the number of cached statements with:

      Code:
      connectionCacheProperties="(InitialLimit=2,MinLimit=2,MaxLimit=10,MaxStatementsLimit=50)"
      You will also need to add ons.jar (from Oracle database directory $ORA_CRS_HOME/opmn/lib) to you app servers classpath (for Tomcat this would be in common/lib).

      Chris

      Comment


      • #4
        As of Oracle 11, the attribute "ONSConfiguration" has been renamed to "onsConfigStr"

        Comment

        Working...
        X