Question: Q 4 . Consider the following two transactions: Tis: read ( A ) . read ( B ) . i f A = 0 then

Q4. Consider the following two transactions:
Tis: read(A).
read(B).
ifA=0 then B;=B+1 :
write (B).
I Ti4: read(B);
read(A):
ifB=0 then A:-A+1 :
write(A).
Let the consistency requirement be A=0vvB=0, with A=B=0 as the initial values.
a) Show that every serial exceution involving these two transactions preserves the eonsistency of the database.
b) Show a concurrent execution of T1 and T1 that produces a nonserializable schedule.
c) Is there a concurrent execution of T1 and T4 that produces a serializable schedule?
d) Add lock and unlock instructions to transactions grad1 and T14 so that they observe the two-phase locking protocol. Can the execution of these transactions result in a deadlock?
 Q4. Consider the following two transactions: Tis: read(A). read(B). ifA=0 then

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!