Show TOC Start of Content Area

Background documentation Introduction to Transactions in J2EE Engine  Locate the document in its SAP Library structure

 

A transaction represents a sequence of operations treated as a unit to satisfy a request and to ensure database integrity. Transactions have the following features, known as ACID characteristics:

·        Atomicity – if the transaction fails, all effects it causes are rolled back. That is, either all changes made by a transaction are reflected on the data in the data store, or none of them.

·        Consistency – the effects of a transaction preserve database integrity.

·        Isolation – all transactions are executed independently of one another. The intermediate states of the transaction are not visible to other transactions.

·        Durability – the results of a transaction are durable and cannot be lost.

In general, there are three types of transactions: flat transactions, chained transactions, and nested transactions. The J2EE Engine supports flat transactions only.

In the J2EE Engine, the Transaction Service is responsible for transaction management. It controls the association and dissociation of the transactions to the tread context in which they are executed. In addition, the Transaction Service manages the lifecycle of the transactions running on the J2EE Engine, and the propagation of the transaction context to other servers. The service comprises two modules – JTA and JTS implementations.

The J2EE Engine provides support for both distributed and local transactions. To provide flawless execution and no data loss in a distributed environment, the Transaction Service supports the two-phase-commit (2PC) protocol for global transactions. The 2PC involves a preparation phase and a commit phase, which is completed only when all branches of the distributed transaction are prepared to commit. This preserves the atomicity of the distributed transactions and ensures the consistency of the data. The support for distributed transactions also enables you to use XA resources

In the applications that access a database, you can use either JTA or local transactions. For more information, see JTA and Local Transactions.

 

End of Content Area