Configuring Transactions 3-13
3.5 Read-only, One-Phase Commit Optimizations
When resource managers, such as the Oracle Database including AQ and RAC, provide read-only optimizations, Oracle WebLogic can provide a read-only, one-phase
commit optimization that provides a number of benefits – even when enabling multiple connections of the same XA transactions – such as eliminating
XAResource.prepare
network calls and transaction log writes, both in Oracle WebLogic and in the resource manager.
For applications that do not require two-phase commit transactions, you can further optimize performance by also disabling the WebLogic “Two Phase Commit” protocol,
which coordinates transactions across two or more resource managers. Disabling two-phase commits, does the following:
■
Removes persistent in-doubt logging and locks, as well as bookkeeping overhead in the database.
■
Removes all checkpoint logging in WebLogic.
■
Enforces andor tests the assumption that a particular server instance does not require two-phase commit.
■
Removes the need for WebLogic migration whole server or service recovery, which in turn removes the need for additional assetscapacity, management, etc.,
involved in such migrations.
3.5.1 Configuring Read-only, One-phase Commit Optimization and Two-phase Commit Disablement
In order to enable the read-only, one-phase commit optimization and disable two-phase commits, configure the following JTA domain configuration attributes:
■
Execute XA Calls In Parallel – Set to false to enable the read-only, one-phase commit optimization.
■
Enable Two Phase Commit – Optionally, set to false to disable two-phase commit transactions. This disables all transaction logging, including checkpoint
records. Any attempt to use two-phase commit will result in a RollbackException being thrown.
Important The Enable Two Phase Commit setting, which is true by default,
should not to be set to false unless it is well-known that the application only uses a resource manager that provides read-only optimization, such as Oracle
database, or that the application only uses a single connection to a single resource manager.
Note: Read-only, One-phase Commit Optimization requires Oracle
DB 11.1.0.7.3PSU or above.
Note: If a XA resource returns an XA_OK vote from a prepare for
example, if it is not an Oracle database, and the WebLogic instance then crashes before rollback can take place, there will be an in-doubt
record and locks will be held in the resource manager database that will need to be manually resolved.
3-14 Programming JTA for Oracle WebLogic Server
For more information on all JTA domain configuration options, see “Configuring JTA Domains” in the WebLogic Administration Console Online Help.
3.5.2 Monitoring Read-only, One-phase Transaction Statistics
For monitoring purposes, there are five transaction processing statistics on the JTA Monitoring page, which together break down the Transaction Committed Total Count
statistic to better track any read-only, one-phase commit transactions.
■
Transaction No Resources Committed Total Count – The total number of transactions with no enlisted resources that were committed since the server was
started.
■
Transaction One Resource One Phase Committed Total Count – The total number of transactions with only one enlisted resource that were one-phase committed
since the server was started.
■
Transaction Read Only One Phase Committed Total Count – The total number of transactions with more than one enlisted resource that were one-phase committed
due to read-only optimization since the server was started.
■
Transaction Two Phase Committed Total Count – The total number of transactions with more than one enlisted resource that were two-phase committed since the
server was started.
■
Transaction LLR Committed Total Count – The total number of LLR transactions that were committed since the server was started.
Note: If the only resource enlisted in a JTA transaction is an LLR data source, then
such transactions are included under the Transaction One Resource One Phase Committed Total Count category rather than the Transaction LLR Committed Total
Count category.
For more information on JTA monitoring statistics, see “Monitoring JTA Statistics” in the WebLogic Administration Console Online Help.
4
Managing Transactions 4-1
4
Managing Transactions
The following sections provide information on administration tasks used to manage transactions:
■
Section 4.1, Monitoring Transactions