Question: Consider the following two transactions: (SHOW WORK) T13: read(A); read(B); if A = 1 then B := B - 1; write(B). T14: read(B); read(A); if

Consider the following two transactions: (SHOW WORK)

T13: read(A); read(B);

if A = 1 then B := B - 1; write(B).

T14: read(B); read(A);

if B = 1 then A := A - 1;

write(A).


Let the consistency requirement be A = 1 or B = 1, with A = 1 and B = 1 as the initial values.
a. Show that every serial execution involving these two transactions preserves the consistency of the database.
b. Show a concurrent execution of T13 and T14 that produces a nonserializable schedule.
c. Is there a concurrent execution of T13 and T14 that produces a serializable schedule?

Step by Step Solution

3.55 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve these problems we need to understand the transactions and how they impact the values of variables A and B We will go through each part of the ... View full answer

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 Programming Questions!