5 votes 5 votes Which of the following concurrency control protocol ensures both conflict and free from deadlock? , Time stamp ordering 2 Phase locking Both (a) and (b) None of the above Databases isro2017 databases transaction-and-concurrency + – sh!va asked May 7, 2017 sh!va 5.0k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply cseBiswajit commented May 7, 2017 reply Follow Share why not (b) 2 Phase locking?? 0 votes 0 votes venkat_sirvisetti commented May 7, 2017 reply Follow Share There may be chance of deadlock in 2 phase locking protocol when: first transaction holds a resource and waits for resource held by the second transaction which is inturn waiting for the resources held by first transaction. But in timestamp ordering, there is no such waiting as such and whichever transaction has the lower timestamp will be done first. So right option is A. 2 votes 2 votes Please log in or register to add a comment.
Best answer 12 votes 12 votes A time stamp and 2PL both ensure CS, but only timestamp is deadlock free erh answered May 7, 2017 selected May 8, 2017 by ManojK erh comment Share Follow See 1 comment See all 1 1 comment reply avinash41 commented Jun 12, 2017 reply Follow Share Option A is correct 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes Option A Timestamp based Protocol ensures freedom from Deadlock as no transaction ever waits, trans'ns are simply rolled back and started afresh with new Timestamp. Akhileshwar Singh answered May 7, 2017 Akhileshwar Singh comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer is A 2-PL has three versions only one of them is deadlock free i.e. Conservative 2-PL. But it is not in practice. From geeksforgeeks, Conservative 2-PL is Deadlock free and but it does not ensure Strict schedule(More about this here!). However, it is difficult to use in practice because of need to predeclare the read-set and the write-set which is not possible in many situations. In practice, the most popular variation of 2-PL is Strict 2-PL. However, Timestamp Ordering is Deadlock free because , Whenever the Basic TO algorithm detects twp conflicting operation that occur in incorrect order, it rejects the later of the two operation by aborting the Transaction that issued it. Schedules produced by Basic TO are guaranteed to be conflict serializable. Introduction to deadlock prevention scheme by Timestamp protocol can be seen here. logan1x answered Dec 21, 2019 logan1x comment Share Follow See all 0 reply Please log in or register to add a comment.