Correct option is A
A wait-for graph is used in database systems to detect deadlocks by representing transactions as vertices and waiting relationships as directed edges.
A precedence graph (serialization graph) is used to determine whether a schedule is conflict-serializable.
In Rigorous Two-Phase Locking (Rigorous 2PL), a transaction holds both read and write locks until it commits or aborts, making it stricter than Strict 2PL.
In Strict Two-Phase Locking (Strict 2PL), at least all exclusive/write locks are held until commit or abort, while shared/read locks may be released earlier.
Information Booster
1. Wait-for Graph → Deadlock Detection
· A wait-for graph contains transactions as vertices.
· An edge indicates that is waiting for a resource/lock held by
· A cycle in the wait-for graph indicates a deadlock in the usual single-instance resource/lock setting.
· Example:
indicates a circular wait and hence a deadlock.
2. Precedence Graph → Serializability
· A precedence graph represents the ordering constraints between transactions in a schedule.
· Each transaction is represented by a vertex.
· An edge is introduced when conflicting operations require to precede
· A schedule is conflict-serializable if and only if its precedence graph is acyclic.
3. Rigorous 2PL → All Locks Until Commit
· Rigorous 2PL requires a transaction to hold all acquired locks, both shared and exclusive, until it commits or aborts.
· Therefore, neither read locks nor write locks are released before the transaction completes.
· It provides strong recoverability and simplifies transaction ordering.
4. Strict 2PL → Write Locks Until Commit
· Strict 2PL requires exclusive (write) locks to be retained until commit or abort.
· Shared locks may be released before commitment, depending on the implementation.
· It prevents transactions from reading or overwriting data written by an uncommitted transaction.
5. Comparison of Strict and Rigorous 2PL
Property | Strict 2PL | Rigorous 2PL |
Write locks until commit | Yes | Yes |
Read locks until commit | Not necessarily | Yes |
All locks until commit | Not necessarily | Yes |
Strength | Less restrictive | More restrictive |