ch18-updated-2019-03-08 Flashcards
(75 cards)
What is a lock in concurrency control?
A mechanism to control concurrent access to a data item
Locks can be in exclusive (X) mode or shared (S) mode.
What are the two modes of locking data items?
- Exclusive (X) mode
- Shared (S) mode
What does an exclusive (X) lock allow?
Both reading and writing of a data item
What does a shared (S) lock allow?
Only reading of a data item
What must a transaction do after requesting a lock?
Proceed only after the lock request is granted
What is a locking protocol?
A set of rules followed by all transactions while requesting and releasing locks
What is deadlock in concurrency control?
A situation where two or more transactions are waiting for each other to release locks
What is one method to handle deadlock?
Roll back one of the transactions involved in the deadlock
What is the Two-Phase Locking Protocol?
A protocol that ensures conflict-serializable schedules with two phases: Growing and Shrinking
What occurs during the Growing Phase of Two-Phase Locking?
Transactions may obtain locks but not release them
What occurs during the Shrinking Phase of Two-Phase Locking?
Transactions may release locks but not obtain new ones
What does strict two-phase locking ensure?
A transaction must hold all its exclusive locks until it commits or aborts
What is rigorous two-phase locking?
A transaction must hold all locks until it commits or aborts, allowing serialization based on commit order
True or False: Two-phase locking is a necessary condition for serializability.
False
What is the purpose of a lock manager?
To manage lock and unlock requests from transactions
What is a wait-for graph?
A directed graph that represents transactions waiting for locks held by other transactions
What indicates that the system is deadlocked when analyzing a wait-for graph?
The presence of a cycle
What is the purpose of deadlock detection?
To identify cycles in the wait-for graph and resolve deadlocks
What is the difference between total rollback and partial rollback?
- Total rollback: Abort and restart the transaction
- Partial rollback: Roll back only as far as necessary to release locks
What is multiple granularity in concurrency control?
A technique allowing data items to be of various sizes with a hierarchy of data granularities
What are intention lock modes?
- Intention-shared (IS)
- Intention-exclusive (IX)
- Shared and intention-exclusive (SIX)
What is the tree protocol in locking?
A graph-based locking protocol that allows only exclusive locks and follows a parent-child locking relationship
What is the phantom phenomenon?
Occurs when a transaction reads a set of data and another transaction inserts data that affects the result of the read
Fill in the blank: A transaction that inserts a new tuple into the database is automatically given an ______ lock on the tuple.
X-mode