Assignment 03
Assignment 03
Lahore Campus
Questions# 1: (5)
During its execution, a transaction passes through several states, until it finally
commits or aborts. List all possible sequences of states through which a transaction may pass.
Explain why each state transition may occur.
Questions# 2: (5)
Consider the following two transactions:
T1: read(A);
read(B);
if A = 0 then B := B + 1;
write(B).
T2: read(B);
read(A);
if B = 0 then A := A + 1;
write(A).
Page 1 of 2
Let the consistency requirement be A = 0 ∨ B = 0, with A = B = 0 the
initial values.
a. Show that every serial execution involving these two transactions pre serves the consistency
of the database.
b. Show a concurrent execution of T1 and T2 that produces a nonserializable
schedule.
c. Is there a concurrent execution of T1 and T2 that produces a serializable
schedule?
Questions# 3: (5)
What is a recoverable schedule? Why is recoverability of schedules desirable?
Are there any circumstances under which it would be desirable to allow non recoverable
schedules? Explain your answer.
Questions# 4: (5)
Consider the following precedence graph. Is the corresponding schedule conflict serializable?
Explain your answer.
Page 2 of 2