



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















Before performing an operation a transaction applies for a S/E lock on an object
If object free or lock compatible then lock granted otherwise transaction will wait
TIME TA TB t 1 XLock (X)^ ……… t 2 …….^ XLock (Y) t 3 Request Y^ …….. t 4 Wait^ Request X t 5 Wait^ Wait t 6 Wait^ Wait
Deadlock prevention
Deadlock detection and resolution
Prevention is not always possible
Deadlock is detected by wait-for
graph
A transaction must acquire a lock
before doing any operation
Locks are only granted in growing
phase, once a transaction enters in shrinking phase no locks can acquire
Database
Area A (^) Area B Area C
File A1 (^) File A2 File A
Rec A11 (^) Rec A12 Rec A
At A111 (^) At A112 At A
When a lock at lower level is applied,
compatibility is checked upward
How will a lock at higher level know
about a lock at lower level
Individual checking is not feasible
While applying for a lock on a node, compatibility with the intension lock is also checked
Share intension lock (SIX)
Conflicts with locks conflicting with S or IX; only one SIX
No locks are used
Guarantees consistency and no deadlocks, however, certain transactions are cancelled
Based on the concept of timestamp
An identifier that determines the relative order of the transactions
Greater timestamp younger the transaction
The transactions’ operations are allowed in the timestamp order
When a transaction wants to read an item that has been updated by a younger transaction
A transaction wants to write an item that has been read or written by a younger transaction
Value read-timestamp write-timestamp 742 6 8