Solved–Homework 6– SOlution

$35.00 $24.00

Problem A: T1 is the oldest transaction, and T3 is the youngest. T1 T2 T3 write D write C read C read C write A read A write A 1. Is this rst schedule con ict-serializable1? Now assume that the transaction manager uses a 2PL protocol where each exclusive/shared lock is set just before it…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

Problem A: T1 is the oldest transaction, and T3 is the youngest.

T1 T2 T3

write D

write C

read C

read C

write A

read A

write A

1. Is this rst schedule con ict-serializable1?

Now assume that the transaction manager uses a 2PL protocol where each exclusive/shared lock is set just before it is needed for the write/read action.

2. If we do not use any deadlock prevention strategy, will the resulting transactions (i) complete, or (ii) deadlock1? If your answer is (i), show a completed schedule; if it is (ii) show the schedule up to the deadlock.

3. If we use a wait-die deadlock prevention strategy will the resulting transactions (i) complete, or (ii) deadlock1? If your answer is (i), show a completed schedule; if it is (ii) show the schedule up to the deadlock.

Now consider a second schedule, as follows:

T1 T2 T3

write D

write C

read C

write A

read C

read A

write A

4. Is this second schedule con ict-serializable1?

Now assume that the transaction manager uses a 2PL protocol where each exclusive/shared lock is set just before it is needed for the write/read action, and answer the following questions for this second schedule.

5. If we do not use any deadlock prevention strategy, will the resulting transactions (i) complete, or (ii) deadlock1? If your answer is (i), show a completed schedule; if it is (ii) show the schedule up to the deadlock.

6. If we use a wound-wait deadlock prevention strategy will the resulting transactions (i) complete, or (ii) deadlock1? If your answer is (i), show a completed schedule; if it is (ii) show the schedule up to the deadlock.

1 Justify your answer using the applicable graph

1

Problem B 1. Consider the following schedule: (w3(A) means that transaction T3 writes

A, C3: T3 commits):

w3(A) r1(A) c3 w1(B) c1 r2(B) w2(C) r4(B) c2c4

(a) Is it a serial schedule?

(b) Is the schedule con ict serializable? If so, what are all the equivalent serial schedules?

(c) Is the schedule recoverable? If not, can we make it recoverable by moving a single commit operation to a di erent position?

(d) Is the schedule cascadeless? If not, can we make it cascadeless by moving a single commit operation to a di erent position?

2