Question

1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent

5. Assume that transaction T1 sets isolation level repeatable read and T1 reads data item A. Does this prevent a second trans

1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent that 2PL does not prevent? 2. What are deadlocks? What are two techniques for detecting and resolving deadlocks? 3. In the figure below, R(X, y) means read database item X into variable y and W(X, y) means write variable y into database item y. Column T1 shows transaction T1's operations and column T2 shows T2's operations. Columns Aand_B show the values of the database items A and B. The first column shows the operation order for the execution schedule. Is the schedule serializable? Why not? T1 T2 25 25 READ(A,t) t=t+100 WRITE(A,t) 125 READ(A,s) s 2 WRITE(A,s) READ(B,s) s = s*2 WRITE(B,S) 4 250 50 READ(B,t) t=t+100 WRITE(B,t) 10 12 150 4. For a given transaction schedule, what is a precedence graph? What property must a schedule's pre graph have for the schedule to be conflict serializable? Give an example of a schedule that is serializable but not conficit serializable
5. Assume that transaction T1 sets isolation level repeatable read and T1 reads data item A. Does this prevent a second transaction T2 from updating A before _T1 commits, that is does T1 lock A and prevent the_T2 write? If the answer is no and T1 rereads A, what happens and how the DBMS prevent an inconsistency? 6. What does the DBMS system do during recovery/restart processing to ensure durability and consistency?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Two-Phase Locking (2PL):
This locking protocol divides the execution phase of a transaction into three parts.
a) First part : When a transaction starts executing, it seeks permission for the locks it requires.
b) Second part : Here the transaction acquires all the locks it seeked in first part.
c) Third part : The third phase starts with the release of first lock by the transaction. In this phase, the transaction cannot acquire any new locks instead it had to release the acquired locks.

Strict Two-Phase Locking (2PL):
In Strict Two-Phase Locking (S2PL), it mostly follows the similar path of 2PL, but it differs in the logic of releasing locks.That is, after acquiring all the locks in the first phase, the transaction continues to execute normally. But in unlike 2PL in third part, Strict-2PL does not release a lock after using it. Strict-2PL holds all the locks until the commit point and releases all the locks at a time.

Since, S2PL holds all the locks till the last execution, it does not face the issue of cascading abort but 2PL fails to prevent it.

Add a comment
Know the answer?
Add Answer to:
1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent that 2PL does not prevent? 2. What are deadlocks? What are two techniques...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT