A set of transactions is serializable if the set produces the same result as some arbitrary serial execution of those same transactions for arbitrary input.
A set of transactions is correct only if it is serializable. The Two-Phase Locking (2PL) protocol ensures the serializability of transactions.
The phases of the Two-Phase Locking protocol are described in the following table:
In the… | A transaction must… |
---|---|
growing phase | acquire a lock on an object before operating on it. The Teradata Optimizer requests locks as close to the beginning of the transaction as possible. |
shrinking phase | release the previously acquired lock and never acquire any more locks after it has released a lock. Lock release is an all-or-none operation. Once acquired, locks are not released until the transaction has committed or is completely rolled back. |