![]() ![]() ![]() ![]() ![]() ![]() ![]() |
This section discusses the following topics:
This section provides an overview of using third-party JDBC drivers with WebLogic Server in distributed transactions. These drivers provide connectivity between WebLogic Server connection pools and the DBMS. Drivers used in distributed transactions are designated by the driver name followed by /XA; for example, Oracle Thin/XA Driver.
The following table summarizes known functionality of these third-party JDBC/XA drivers when used with WebLogic Server:
WebLogic Server ships with the Oracle Thin Driver version 10g preconfigured and ready to use. If you want to update the driver or use a different version, see Using the Oracle Thin Driver in Programming WebLogic JDBC.
The following sections provide information for using the Oracle Thin/XA Driver with WebLogic Server.
The Oracle Thin/XA Driver requires the following:
See " Using the Oracle Thin Driver" in Configuring and Managing WebLogic JDBC.
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 will fail with XAER_RMERR
. Crash recovery is a standard operation for an XA resource.
The following table contains sample code for configuring a JDBC data source:
The following sections provide important configuration information and performance issues when using the Sybase jConnect Driver 5.5 and 6.0/XA Drivers:
Follow these instructions to set up the environment on your database server:
p_configure
"enable DTM",1
to enable transactions.sp_configure "enable xact coordination",1.
dtm_tm_role
to <USER_NAME>.
xa_config
file from the SYBASE_INSTALL\OCS-12_0\sample\xa-dtm
subdirectory up three levels to SYBASE_INSTALL,
where SYBASE_INSTALL
is the directory of your Sybase server installation. For example: $ SYBASE_INSTALL\xa_config
xa_config file
. In the first [xa
] section, modify the sample server name to reflect the correct server name.To prevent deadlocks when running transactions, enable row level lock by default:
Note: | Both the jConnect.jar, jconn2, and jconn3.jar files are included in the WL_HOME \server\lib folder and are referenced in the weblogic.jar manifest file. When you start WebLogic Server, the drivers are loaded automatically and are ready to use with WebLogic Server. To use these drivers with the WebLogic utilities or with other applications, you must include the path to these files in your CLASSPATH . |
Correct support for XA connections is available in the Sybase Adaptive Server Enterprise 12.0 and later versions only. XA connections with WebLogic Server are not supported on Sybase Adaptive Server 11.5 and 11.9.
Prior to Adaptive Server version 12.0, all resources of a transaction were privately owned by a single task on the server. The server could not share a transaction with any task other than the one that initiated the transaction. Adaptive Server version 12.x includes support for the suspend and join semantics used by XA-compliant transaction managers (such as WebLogic Server). Transactions can be shared among different execution threads, or may not be associated with an execution thread (detached).
On the Sybase server, you can set the dtm detach timeout period
, which sets the amount of time (in minutes) that a distributed transaction branch can remain in the detached state (without an associated execution thread). After this period, the DBMS automatically rolls back the transaction. The dtm detach timeout period
applies to all transactions on the database server. It cannot be set for each transaction.
For example, to automatically rollback transactions after being detached for 10 minutes, use the following command:
sp_configure 'dtm detach timeout period', 10
You should set the dtm detach timeout period
higher than the transaction timeout to prevent the database server from rolling back the transaction before the transaction times out in WebLogic Server.
For more information about the dtm detach timeout period
, see the Sybase documentation.
If a global transaction is started on the Sybase server, but is not completed, the outcome of the transaction varies depending on the transaction state before the transaction is abandoned:
xa.end
call, the transaction is rolled back. xa.end
call, the transaction remains on the database server (and holds all relevant locks).xa.start
but has not called xa.end
and the application terminates unexpectedly, the database server immediately rolls back the transaction and frees locks held by the transaction.xa.start
and xa.end
and the application terminates unexpectedly, the database server rolls back the transaction and frees locks held by the transaction after the dtm detach timeout period
has elapsed. See Setting the Timeout for Detached Transactions.xa.start
and xa.end
, and then the transaction is prepared, if the application terminates unexpectedly, the transaction will persist so that it can be properly recovered. The Transaction Manager must call rollback or commit to complete the transaction.Set the following configuration properties when running a Java client.
These are the known issues and BEA workarounds:
To use other third-party 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.
![]() ![]() ![]() |