HP Integrity NonStop H-Series User Manual
Page 98

useExternalTransaction
. When this attributes is turned ON, the JDBC driver does not start
any TMF transaction of its own and performs work in the transaction context of the calling thread.
In NSASJ the transaction of the calling thread is initiated and controlled by XARM. When the
application executes any DML statements and when the container (or the application) commits the
transaction, XARM too being a participant tries to commit the TMF transaction. The internal commit
protocol of XARM has larger commit latency of about 12ms. Now this can be avoided by setting
the useExternalTransaction flag to OFF. In this setting the driver internally starts and manages
the TMF transaction for all the database related activities without involving the XARM. The driver
with the help of the DataSource implementation of NSASJ (inherited by JBoss) co-ordinates with
the JDBC activities with the Transaction Manager to ensure that the database operations are
committed when the XA transaction is committed.
T2 driver
SQLMX JDBC T2 driver provides an attribute called transactionMode which can have values
of internal, mixed, and external. To understand the implications of these values in NSASJ
it is necessary to understand how the T2 driver handles the transaction contexts. The T2 driver
stores the transaction context in the thread context in which the JDBC calls are executed. A single
T2 connection can participate in a global transaction spanning multiple invocations of the EJB.
The container does not guarantee that EJB invocations within an XA transaction use the same
thread. So this means that the T2 connection participating in the global transaction ends up starting
a new transaction each time it gets invoked in a different thread. This situation can be catastrophic
and lead to application outage. Therefore, using the T2 driver with transactionMode set to
internal
must be avoided in NSASJ.
When the transactionMode is set to mixed the driver uses the thread’s transaction context if
there is one for all its operations. In NSASJ, it is likely that an EJB is invoked within a global
transaction context and hence a TMF transaction context. Therefore, with transactionMode of
mixed
, the T2 driver always performs its work in the TMF transaction context controlled by XARM.
Although this is the preferred mode of operation, the transaction commit latency (explained while
discussing the T4 driver) cannot be avoided.
When the transactionMode is set to external the driver expects the calling thread to be in
a TMF transaction context. The behavior in NSASJ is the same as explained in the mixed mode
above.
98
Internal description of NSASJ components