Quiz 4 (Transactions) Flashcards
Transaction
An execution of a user program, seen by the DBMS as a series or list of operations; operations may include read, write, commit, rollback (abort).
ACID
Four properties of transactions to maintain data in the face of concurrency and possible failures; Atomicity, Consistency, Isolation, Durability.
Atomicity
Either all actions are carried out or none are.
Consistency
When the user submits a transaction against a database that is in a consistent state, and that transation runs to completion, the data will remain in a consistent state; consistency is the responsibility of the user.
Isolation
Transactions are isolated from the effects of other concurrently running (interleaved) transaction.
Durability
Once the DBMS informs the user that a transaction has been successfully completed, its effects should persist regardless of system crashes or failures.
Schedule
A list of actions (reading, writing, committing, rolling back (aborting) from a set of transactions; the order in which two actions of a transaction T appear in a schedule must be the same order as in the transaction.
Concurrency
Running the individual steps of multiple transactions interleaved together to take advantage to improve performance; isolation of transactions must be maintained.
Serializable Schedule
A schedule of a set of transactions that is equivalent to running them serially.
Conflicting Actions
Actions in two or more transactions that may conflict with each other; always involves a write operation as one of the actions.
Reading Uncommitted Data Conflicting Action
A transaction T2 could read a database object A that has been previously modified by another transaction T1 (dirty read).
Unrepeatable Read Conflicting Action
Transaction T2 could change the value of an object A that has been read by a transaction T1 while T1 is still in progress.
Overwriting Uncommitted Data Conflicting Action
A transaction T2 could overwrite the value of an object AA which has already been modified by transaction T1 while T1 is still in progress.
Strict Two-Phase Locking (Strict 2PL)
A protocol used by DBMS’s to ensure that only serializable recoverable schedules are allowed and that no action of committed transactions are lost while undoing aborted transactions.
Strict 2PL has two rules:
- If a transaction T wants to read (or modify) an object, it first requests a shared (or exclusive) lock on the object.
- All locks held by a transaction are released when the transaction is completed.
Table Locking
Place a shared or exclusive lock on an entire table.