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.
A transaction can be divided into other basic units, subtransactions.
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 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
|
||