Name: Hamida Batool (38615) Department: CS(A)
Advanced Database Management Systems – Assignment 01
Question 01:
In this assignment you are going to execute the following transactions using strict
and rigorous two-phase locking protocols. Moreover, you need to list the order in
which the transactions are going to end. Finally, briefly compare your answers
(transactions end order) of strict and rigorous two-phase locking protocols.
T9 T12 T13 T14 T15 T16 T19
Read(X)
Read(Y) Read(Z)
Read(U)
Read(V)
Write(U)
Read(V)
Write(V)
Read(W)
Write(W)
Write(U)
Read(X)
Write(X)
Write(W)
Read(X)
Write(X)
Write(Y)
Read(X)
Write(X)
Write(Z)
Strict two-phase locking: It should satisfy the basic two-phase lock and
exclusive locks should hold until commit/abort.
Name: Hamida Batool (38615) Department: CS(A)
T9 T12 T13 T14 T15 T16 T19
Lock-X(U) Lock-X(X) Lock-S(Z)
Read(U) Read(X) Read(Z)
Lock-S(V) Lock-X(Y)
Read(V) Read(Y)
Write(U)
Lock-X(X)
Read(X) Lock-X(W)
Write(X) Read(W)
Commit Write(W) Lock-X(U)
UL(U) Write(U) Lock-X(X)
UL(V) Lock-X(V) Read(X)
UL(X) Read(V) Write(X)
Write(V) Lock-S(X) Commit Write(W)
Commit Read(X) Lock-X(Z) UL(Z)
UL(V) Write(X) Commit Write(Z) UL(X)
Write(Y) UL(W) Commit
Commit UL(X) UL(U)
UL(X) UL(Z)
UL(Y)
Rigorous two-phase locking: It should satisfy the basic two-phase lock and all
shared, exclusive locks should hold until commit/abort.