Locking Mechanism Flashcards
What can be done to ensure serializability?
Data items must be accessed in mutually exclusive manner.
How is lock table usually implemented?
As an in memory hash table indexed on the name of the data item being locked.
Give status an representation of different type of requests in a lock table.
New request is added to end of queue. Granted if compatible with all earlier locks.
Unlock requests result in request being deleted.
If transaction aborts, all lock requests are deleted.
What is a lock?
A mechanism to control concurrent access to a data item.
Name two modes in which data items can be locks.
X - Exclusive
S - Shared
What is a locking protocol?
A set of rules followed by all transactions while requesting and releasing locks.
What does two phase locking protocol ensure?
Serializability.
Name phases of two phase locking protocol.
Growing
Shrinking
What is strict two phase locking?
Here, a transaction must hold all it’s exclusive locks till it commits/aborts.
What is W time stamp?
Largest time-stamp of any transaction that executed write(Q) successfully.
What is R time stamp?
Largest time-stamp of any transaction that executed read(Q) successfully.
What is granularity of locking?
Level in tree where locking is done.
Fine and coarse.
What is intention lock?
When a node is in intention lock, explicit lock is being done at lower level of tree.
Name intention lock modes.
IS
IX
SIX