Entering content frame

Transaction Locate the document in its SAP Library structure

A transaction is a sequence of sql statements that are handled by the database system as a basic unit, in the sense that any modifications made to the database by the sql statements are either all reflected in the state of the database, or else none of the database modifications are retained.

The first transaction is opened when a database session is opened with the CONNECT statement. The transaction is concluded with the COMMIT statement or the ROLLBACK statement. When a transaction is successfully concluded with a commit statement, all of the changes to the database are retained. If a transaction is aborted using a rollback statement, on the other hand, or if it is aborted in another way, all of the changes to the database made by the transaction are rolled back.

Both the COMMIT and ROLLBACK statements open a new transaction implicitly.

A transaction can be divided into other basic units, subtransactions.

Locks

Since the database system permits concurrent transactions on the same database objects, locks on rows, tables, and the database catalog are necessary to isolate individual transactions.

For information about the lock concept, see the The SAP DB Database System, Lock Behavior section.

·        The assignment of implicit locks can be affected by the setting of the isolation level with the CONNECT statement.

·        Locks can be assigned explicitly using the LOCK statement or by the assignment of a LOCK option.

·        Exclusive locks for rows that have not yet been modified, and share locks on rows can be released by the UNLOCK statement before the end of the transaction.

The locks assigned to a transaction are usually released at the end of the transaction, making the respective database objects accessible again to other transactions.

SQL Statements for Transaction Management

CONNECT Statement

SET Statement

 

COMMIT Statement

ROLLBACK Statement

SUBTRANS Statement

LOCK Statement

UNLOCK Statement

RELEASE Statement

 

 

Leaving content frame