Network Deployment (Distributed operating systems), v8.0 > Establishing high availability > Establishing high availability for Data access resources > Configure Oracle Real Application Cluster (RAC) with the application server
Configure Oracle connection caching in the application server
We can elect to configure an Oracle data source to use the Oracle connection caching feature instead of using the application server connection pooling. Connection caching for Oracle databases is similar to connection pooling in the application server. Currently, Oracle supports connection caching only with data sources that use the oracle.jdbc.pool.OracleDataSource implementation class, instead of the oracle.jdbc.pool.OracleConnectionPoolDataSource or oracle.jdbc.xa.client.OracleXADataSource classes. By default, the Oracle JDBC providers in the application server are configured to use the oracle.jdbc.pool.OracleConnectionPoolDataSource for non-XA data sources, or oracle.jdbc.xa.client.OracleXADataSource for XA data sources.
To enable Oracle connection caching, configure and use a new JDBC provider in the application server that implements the oracle.jdbc.pool.OracleDataSource class. Oracle connection caching does not support XA.
- Create a data source and user-defined JDBC provider.
- Click Resources > JDBC > Data sources
- Select a server from the Scope drop-down list.
- Click New.
- Enter the name and JNDI name for the data source. Click Next.
- Create a JDBC provider. Select Create new JDBC provider, and click Next.
- Define the required properties for the JDBC provider. Use the following configuration settings:
- Database type: User-defined
- Implementation class name: oracle.jdbc.pool.OracleDataSource
- Enter the class path for ojdbc6.jar, and click Next.
- For Data store helper class name, enter com.ibm.websphere.rsadapter.Oracle11gDataStoreHelper. Click Next.
- Define the security aliases for this data source, and click Next.
- Finish the wizard.
- Save the configuration changes.
- Configure the data source that you created.
- Click the name of the data source. The configuration panel displays.
- Select Custom properties, and create or modify the properties for this data source. Enter or update the following custom properties:
The order in which the custom properties are set is important. The setting order can be an issue because the application server passes the properties as a collection and the order is not guaranteed. If you encounter this issue, contact Oracle and reference Oracle bug #6638862.
Name Value disableWASConnectionPooling true You must also set the maximumPoolSize attribute to 0 on WAS connection pool settings to allow Oracle to control the pool boundaries. connectionCachingEnabled true connectionCacheName your_cache_name removeExistingOracleConnectionPoolIfExists true The removeExistingOracleConnectionPoolIfExists property must be set to true so the application server removes any existing Oracle connection pools with an identical name. Otherwise, the Oracle data source fails the getConnection method if the pool name that is created has a name that is identical to an existing pool.
For example, if you run a test connection, the test connection process creates an Oracle connection pool that prevents the application server from working properly at run time.
- Click Apply or OK.
- Save the changes to the application server configuration.
- Restart the application server.
ResultsOracle does not display a message if the pool creation fails, and a normal connection is returned instead. We can confirm that the Oracle connection pool is created by using the admin console test connection function for the data source. First, turn on trace with the trace string, "RRA=all", for the server that runs the application. Then, issue a test connection. Issue a second test connection. Both test connections should work. Examine the trace log.
If the Oracle connection pool was created successfully, the trace shows that the second test connection detected that the Oracle connection cache exists because of the first test connection, and was successful in removing it so that it can be created again by the second test.
Configure Oracle Real Application Cluster (RAC) with the application server
Configure two-phase commit distributed transactions with Oracle RAC
Configure a JDBC provider and data source