Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Database: Transactions and Concurrency Control Consider the following two transactions:

Database: Transactions and Concurrency Control

Consider the following two transactions:                                                      

T0: read(A);

     read(B);

     if A=0 then B:=B+1;

     write(B).

T1: read(B);

     read(A);

     if B=0 then A:=A+1;

     write(A).

1)   Let the consistency requirement be A=0 \/ B=0, with A=B=0 the initial values.


                            i.          Show that every serial execution involving these two transactions preserves the consistency of the database.                                                               (4 points)

                       

                          ii.          Show a concurrent execution of T0 and T1 which produces a nonserializable schedule.                                                                                              (4 points)


                        iii.          Is there a concurrent execution of T0 and T1 which produces a serializable schedule?                                                                                         (4 points)

2) Add lock and unlock instructions to T0 and T1, so that they observe the two-phase locking protocol.                                                                                                     (4 points)

3) Can the execution of the above two-phase locking transactions result in a deadlock?

                                                                                                                            (4 points)


4) Show how two-phase locking helps avoid the non-serializable schedule of your answer to 1).ii.  

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Portfolio Theory and Investment Analysis

Authors: Edwin Elton, Martin Gruber, Stephen Brown, William Goetzmann

9th edition

9781118805800, 1118469941, 1118805801, 978-1118469941

More Books

Students also viewed these Databases questions

Question

Differentiate the function. f(x) = ln(x 2 + 10)

Answered: 1 week ago

Question

Briefly describe the terms lean and Six Sigma.

Answered: 1 week ago