IBM Support

Defined two datasources to use two different JDBC drivers, but both datasources are using the same JDBC driver

Troubleshooting


Problem

If the different versions JDBC driver have the same classnames, then whichever classes are loaded first are used. Since JDBC provider classes are loaded by a WebSphere Application Server classloader, if you define JDBC providers that use different JDBC drivers of the same family (for example, both Oracle 10g and Oracle 11g thin driver), then which JDBC driver gets loaded is determined by which JDBC provider is processed first by the WebSphere Java™ Virtual Machine (JVM). For example, if you define one JDBC provider to use driver for Oracle 10g and another JDBC provider to use Oracle 11g, and define two datasource's, one using each JDBC provider. The SystemOut.log file will show that both datasources are using the same driver.

Cause

When classes get loaded into the JVM, only one set of the JDBC provider's classes is loaded. When the datasource is created, it uses whichever JDBC driver is already loaded in the JVM. This is working as designed.

Resolving The Problem

Since most drivers are backward compatible, the later driver should be used. In addition, you have the ability in WebSphere Application Server v7.0 and later to isolate the resource provider. Selecting isolate this resource provider specifies that this resource provider will be loaded in its own class loader. This allows different versions or implementations of the same resource provider to be loaded in the same Java Virtual Machine. Give each version of the resource provider a unique class path that is appropriate for that version or implementation. Please note all JDBC resource providers for the database vendor must be isolated.


To view this property and other JDBC provider settings: Open the administrative console page, click Resources > JDBC > JDBC providers > JDBC_provider

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Classloader","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0","Edition":"Base;Enterprise;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"7.0;6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

55997;660;706

Document Information

Modified date:
15 June 2018

UID

swg21200379