When you use the Application Server-managed transactions, you integrate the Application Server transaction manager and the resource manager (such as DBMS) that manages the resources to manage the transactions. In this case, you choose either a local transaction or a global transaction as the transaction type.
This subsection describes the local transactions and global transactions.
You use a local transaction when only one resource manages the transactions. When you use a local transaction, the resource manager concludes the transaction.
You use a global transaction when multiple resources manage the transactions. When you use a global transaction, the transaction manager adjusts the multiple resource transactions and concludes the transactions in such a way that the consistency is not lost. The two-phase commit protocol is used to conclude the transactions. Note that when you use a global transaction, the in-process transaction service is used. For details on the in-process transaction service, see 3.14.6 In-process transaction service.
The cost of processing a global transaction is comparatively higher, so we recommend that you use a local transaction when the transactions are managed by a single resource only.
Note that the light transaction functionality # is enabled by default, so you cannot use a global transaction. To use a global transaction, you must disable the light transaction functionality.
The light transaction functionality provides an optimal environment for the local transactions.
The following table describes the mapping between the transaction management methods and light transactions.
Table 3-11 Mapping the transaction management methods and light transactions
Transaction management method | Light transaction enabled | Light transaction disabled | |
---|---|---|---|
Application Server-managed transactions | Local transaction | Y | Y |
Global transaction | N | Y | |
Non-Application Server-managed transactions | Y | Y |
Legend:
Y: Available
N: Not available
For details on the light transaction functionality, see 3.14.5 Light transactions.