How to Enable Oracle Universal Connection Pooling (UCP) in WebSphere Application Server

Technote (FAQ)


Question

How can Oracle Universal Connection Pooling (UCP) be enabled in WebSphere Application Server?

Cause

The ability to utilize the Oracle Universal Connection Pooling (UCP) feature has been added to WebSphere Application Server under APAR PM44388, which is included in Fix Pack 23 (V7.0.0.23) and above for WebSphere Application Server V7.0. When Oracle UCP is used, the WebSphere Application Server connection pooling implementation must be disabled.

Answer

After installing Fix Pack 23 or higher, follow these steps:

1. Create a User-defined JDBC Provider.

In the administrative console, expand Resources, then JDBC, and select JDBC providers. Select the scope at which you'd like to create the JDBC Provider, and click the New button. For the Database type, select User-defined from the drop-down list. For Implementation class name, enter either oracle.ucp.jdbc.PoolDataSourceImpl or oracle.ucp.jdbc.PoolXADataSourceImpl. Click Next when done.

For the class path, enter the following:

${User-defined_JDBC_DRIVER_PATH}/ojdbc6.jar
${User-defined_JDBC_DRIVER_PATH}/ucp.jar

Be sure to update the WebSphere variable User-defined_JDBC_DRIVER_PATH to the directory location where these JARs are located. The two JAR files must also be from the exact same version and fix level of the Oracle JDBC driver.

Click Next to continue, and then verify the Summary information. Click Finish when done, and then save and synchronize the configuration change.

2. Create a data source.

Select the newly created JDBC Provider in the administrative console. Under the Additional properties heading, select Data sources. Click the new button to create a new data source. Provide a JNDI name for the data source (should start with "jdbc/"). Click Next to continue.

Set the Data store helper class name to com.ibm.websphere.rsadapter.Oracle11gDataStoreHelper, and then click Next to continue.

Select an existing J2C authentication alias for the Component-managed authentication alias and Container-managed authentication alias, or create a new alias by clicking the "Global J2C authentication alias" link, and then select the new alias for the Component-managed authentication alias and Container-managed authentication alias. Set the Mapping-configuration alias to DefaultPrincipalMapping.

Click Next to continue, and then verify the Summary information. Click Finish when done, and then save and synchronize the configuration change.

3. Configure the new data source.

Select the newly created data source in the administrative console. Under the Additional properties heading, select Connection pool properties. Set both the Minimum Connections and Maximum Connections to 0. Click OK when done.

Under the Additional properties heading for the data source, select WebSphere Application Server data source properties. Set the Statement cache size to 0. Click OK when done, and then save and synchronize the configuration changes.

4. Create custom properties for the new data source.

Select the newly created data source in the administrative console. Under the Additional properties heading, select Custom properties. Click the New button to create three new custom properties:

Name: disableWASConnectionPooling
Value: true

Name: URL
Value. jdbc:oracle:thin:@//localhost:1521/orcl
Customize the URL to connect to your Oracle database. Contact your DBA if you do not have the URL.

Name: connectionFactoryClassName
Value: oracle.jdbc.pool.OracleDataSource

You can create additional custom properties to configure Oracle UCP. For example, to set the maximum pool size for UCP:

Name: maxPoolSize
Value: 5

See Oracle documentation for additional UCP properties that can be set.

UCP properties can also be set in the application. For example:

if (ds.isWrapperFor(oracle.ucp.jdbc.PoolDataSource.class)) {
PoolDataSource pds =
ds.unwrap(oracle.ucp.jdbc.PoolDataSource.class); pds.setMaxPoolSize(5); } else if (ds.isWrapperFor(oracle.ucp.jdbc.PoolXADataSource.class)) {
PoolXADataSource pdsxa =
ds.unwrap(oracle.ucp.jdbc.PoolXADataSource.class); pdsxa.setMaxPoolSize(5); }

When done creating the custom properties, save and synchronize the configuration changes.

5. Test the connection.

Select the newly created data source in the administrative Console, and click the "Test connection" button to check to see if the data source can connect to the database.

If the connection fails, Review at the JVM server and FFDC logs for messages that indicate the problem with the connection. Resolve any problems with connection to the database and try again until the test connection is successful.

6. Use the data source.

The newly created data source can now be used in your application to get a connection to the Oracle database, in the same way as any other data source. The difference will be that Oracle UCP will be used instead of WebSphere Application Server connection pooling.

Related information

APAR PM44388

Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere Application Server
DB Connections/Connection Pooling

Software version:

7.0

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Software edition:

Base, Network Deployment

Reference #:

1578034

Modified date:

2013-02-15

Translate my page

Machine Translation

Content navigation