Entering content frame

Transactions Locate the document in its SAP Library structure

The first transaction is opened when a database session is opened with the CONNECT statement. You can use a SET statement to change the properties of a database session. The transaction is concluded with the COMMIT, ROLLBACK, or RELEASE statement. The RELEASE statement also closes the database session.

Subtransactions

A transaction can be divided into other basic units, namely, subtransactions. You can use one of the following procedures to open or close subtransactions:

·        Using the SUBTRANS statements
A subtransaction is initiated by the SUBTRANS BEGIN statement and concluded with the SUBTRANS END or SUBTRANS ROLLBACK statements.

·        Using a savepoint
A subtransaction is initiated by a SAVEPOINT statement and closed with a ROLLBACK TO statement.

Choose one of the procedures and stick with it.

Subtransactions do not affect locks. These are only released by COMMIT or ROLLBACK. COMMIT or ROLLBACK implicitly close all 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.

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

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

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

The locks assigned to a transaction are 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

SAVEPOINT-/ROLLBACK TO Statement

LOCK Statement

UNLOCK Statement

RELEASE Statement

 

 

 

Leaving content frame