12 Using JDBC XA Drivers with WebLogic Server
An XA data source DB user requires certain DBA table grants in order to recover pending transaction branches from the Oracle database. We now provide the ability to use two different DB credentials one for XA recover processing (with DBA privileges) and different DB credentials for application processing (no DBA privileges).
Data Source configuration allows specification of a database user and password that are used to create JDBC connections for XA recover processing. These credentials can be different from the database user and password used for JDBC application data. Configuration of separate XA recover credentials is optional and existing data source configurations will continue to support XA recovery as long as the database user is granted the appropriate permissions.
The XA recover credentials will be specified in a XA data source configuration using the WLS-internal driver properties weblogic.jdbc.xaRecoverUser and weblogic.jdbc.xaRecoverPassword. If XA recover credential properties are defined in a non-XA data source configuration they are ignored.
Using Oracle Thin/XA Driver
WebLogic Server ships with the Oracle Thin Driver pre-configured and ready to use.
If you want to update the driver or use a different version, see Using API Extensions in JDBC Drivers in Developing JDBC Applications for Oracle WebLogic Server.
Set the Environment for the Oracle Thin/XA Driver
The following sections explain how to set the environment for the Oracle Thin/XA Driver.
Configure WebLogic Server
For information on how to configure WebLogic Server for use with the Oracle Thin/XA Driver, see Using API Extensions in JDBC Drivers in Developing JDBC Applications for Oracle WebLogic Server.
Enable XA on the Database Server
To prepare the database for XA, perform these steps:
If the above steps are not performed on the database server, normal XA database queries and updates may work fine. However, when the WebLogic Server Transaction Manager performs recovery on a re-boot after a crash, recover for the Oracle resource fails with XAER_RMERR
. Crash recovery is a standard operation for an XA resource.
Oracle Thin/XA Driver Configuration Properties
For information on how to configure data source properties, see Configuring JDBC Data Sources in Administering JDBC Data Sources for Oracle WebLogic Server.
Using Other XA Drivers
To use other XA-compliant JDBC drivers, you must include the path to the driver class libraries in your CLASSPATH
and follow the configuration instructions provided by the vendor.
Using WebLogic-branded Data Direct Drivers
For information on how to configure WebLogic Server for use with WebLogic-branded Data Direct drivers, see Using WebLogic-branded DataDirect Drivers in Developing JDBC Applications for Oracle WebLogic Server
Additional Considerations
Your data base vendor may provide instructions to perform steps to prepare your environment for XA. These steps may include how to:
-
Enable your data base server for XA. This may include granting additional user permissions.
-
Compensate for vendor-specific transactional behavior, such as threading, timeout, and rollback behavior.
-
Use vendor-specific connection properties.
Consult your data base vendor documentation for specific details.