Technical data

JDBC Configuration Guidelines for Connection Pools, MultiPools and DataSources
Administration Guide 16-21
Non-XA Driver/Single Resource
If you are using only one non-XA driver and it is the only resource in the transaction,
leave the Enable Two-Phase Commit option unselected in the Administration Console
(accept the default
enableTwoPhaseCommit = false). In this case, Weblogic Server
ignores the setting and the Transaction Manager performs a one-phase optimization.
Non-XA Driver/Multiple Resources
If you are using one non-XA JDBC driver with other XA resources, select Enable
Two-Phase Commit in the Console (
enableTwoPhaseCommit = true).
When
enableTwoPhaseCommit is set to true, the non-XA JDBC resource always
returns
XA_OK during the XAResource.prepare() method call. The resource
attempts to commit or roll back its local transaction in response to subsequent
XAResource.commit() or XAResource.rollback() calls. If the resource commit
or rollback fails, a heuristic error results. Application data may be left in an
inconsistent state as a result of a heuristic failure.
When Enable Two-Phase Commit is not selected (
enableTwoPhaseCommit is set to
false), the non-XA JDBC resource causes XAResource.prepare() to fail. This
mechanism ensures that there is only one participant in the transaction, as
commit()
throws a
SystemException in this case. When there is only one resource participating
in a transaction, the one phase optimization bypasses
XAResource.prepare(), and
the transaction commits successfully in most instances.
This non-XA JDBC driver support is often referred to as the "JTS driver" because
WebLogic Server uses the WebLogic JTS Driver internally to support the feature. For
more information about the WebLogic JTS Driver, see "Using the WebLogic JTS
Driver" in Programming WebLogic JDBC.
Limitations and Risks When Using a Non-XA Driver in Global Transactions
WebLogic Server supports the participation of non-XA JDBC resources in global
transactions, but there are limitations that you must consider when designing
applications to use such resources. Because a non-XA driver does not adhere to the
XA/2PC contracts and only supports one-phase commit and rollback operations,
WebLogic Server (through the JTS driver) has to make compromises to allow the
resource to participate in a transaction controlled by the Transaction Manager.