user manual

Chapter 19: Transaction management 199
Transaction manager services
needed, therefore avoiding unnecessary RPCs involving JTA XAResource
objects and the OTS engine, greatly improves your application's performance.
Using multiple JDBC connections for access to multiple database resources
from a single vendor in the same transaction:
In scenarios involving multiple databases from a single vendor, it is often
possible to avoid using two-phase commit. You can access one database and
use it to access the second database by tunneling access through the
connection to the first database. Oracle and other DBMSs provide this
capability. In this case the BES Partition can be configured with only one
JDBC connection to the "fronting" database. Access to the "backing" database
is tunneled through the first JDBC connection.
Using multiple JDBC connections to the same database resource in the same
transaction:
When multiple JDBC connections to the same database are obtained and
used by distributed participants within a single transaction, a two-phase
commit can be avoided. The JDBC connections, as expected, need to be
obtained from a XA datasource. But, rather than performing a two-phase
commit, a one-phase commit can be used to complete the transaction since
only a single resource is involved. This is achieved by using the Transaction
Manager rather than the OTS engine. An alternative is to collocate all EJBs
involved in the transaction, rather than having them deployed in distributed
Partitions. In this case, a non-XA datasource is used and no two-phase
commit is required.
Using multiple disparate resources in a single transaction:
In this case there is a need for a two-phase commit transaction. This situation
arises when, for example, you are running a single transaction against both
Oracle and Sybase, or if you have a transaction that includes access to an
Oracle database and a JMS provider, such as MQSeries. In the latter case,
the transaction is coordinated using JTA XAResource object, obtained from
Oracle via JDBC and MQSeries via JMS, and enables both resources to
participate in the two-phase commit transaction completion. It is worth noting
that two-phase commit capabilities (provided by the OTS engine), are only
needed when a single transaction involves access to multiple incompatible
resources.
Note In order to utilize the OTS engine as the default transaction service, the
Transaction Manager must be stopped first.
EJBs and 2PC transactions
With the introduction of messaging in the J2EE platform, a number of common
scenarios now exist involving access to multiple resources from EJBs in a
single transaction . As we know, when more than one resource is involved in a