Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION B2. (10 marks) (a) (6 marks) Consider a database with objects A, B and C, and the following two trans- actions Ti and T2

image text in transcribed
QUESTION B2. (10 marks) (a) (6 marks) Consider a database with objects A, B and C, and the following two trans- actions Ti and T2 involving those objects: T1 begin transaction T2 read (A) read (B) read(C) begin transaction read (A) read (B) read (C) C := C+1 write (B) write (C) commit rite (A) rite (C) commit Let the initial values of A, B and C be 0; and the consistency requirement be: either A 0 or B 0. (i) Show that every serial execution of these two transactions preserves the consis- tency of the database (ii) Give an example of a non-serial schedule involving all the operations that con- stitute transactions T and T2 such that it (the non-serial schedule schedule you constructed) results in a lost update problem. observe the two-phase locking protocol (2PL) problem as identified in(i) above. (iii) Add lock and unlock instructions to the transaction Ti and T2 so that they (iv) Explain how the use of two-phase locking protocol can resolve the lost update (b) (4 marks) Discuss whether any concurrent execution of the two transactions Ti and T2 shown in part (a) can result in a deadlock. In your answer focus only on the lock/unlock instructions that you have introduced in part ai). If there is a deadlock, describe how could it have been prevented, if at all

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_2

Step: 3

blur-text-image_3

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago

Question

=+Are they specific or general in nature?

Answered: 1 week ago

Question

=+ What is the nature of the contracts or agreements with unions?

Answered: 1 week ago