2 votes 2 votes Which of the following protocols does not ensure conflict serializability and safety from deadlocks? Graph based protocols Two-phase locking protocol Time-stamp ordering protocol Both a & b Databases transaction-and-concurrency databases + – yogi_p asked Nov 18, 2017 yogi_p 1.5k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Rupendra Choudhary commented Nov 18, 2017 reply Follow Share don't know about graph based protocols but 2PL ensures conflict serializability but don't guarantee about deadlock free transaction and Time stamp protocol ensures both deadlock free transaction as well as conflict serializability. 1 votes 1 votes yogi_p commented Nov 18, 2017 reply Follow Share The Main Question is about Graph Based protocol, There is no explicit mention about it 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes Graph based protocols and timestamp ordering protocols ensure both conflict serializability and free from deadlocks. But 2-phase locking protocol ensures only conflict serializability but not free from deadlocks pradeepdeepu answered Nov 18, 2017 selected Dec 2, 2017 by yogi_p pradeepdeepu comment Share Follow See all 2 Comments See all 2 2 Comments reply yogi_p commented Nov 18, 2017 reply Follow Share Provide some source or a definite proof behind your comment about graph based protocol. 0 votes 0 votes pradeepdeepu commented Nov 18, 2017 i edited by pradeepdeepu Nov 18, 2017 reply Follow Share In graph based protocols ,we are restricted to use only rooted trees and exclusive locks only. It is also called tree protocol , it works as Each transaction Ti can lock a data item at most once, and must observe the following rules: 1. The first lock by Ti may be on any data item. 2. Subsequently, a data item Q can be locked by Ti only if the parent of Q is currently locked by Ti . 3. Data items may be unlocked at any time. 4. A data item that has been locked and unlocked by Ti cannot subsequently be relocked by Ti . So, we cant get deadlocks here. Since here if we want to access an element in the tree ,it has to follow the order from parent or root down to the leaf Suppose in this graph if you have locked first on D and then you want to lock H and I.deadlock may possible if some transaction has already locked H or J and waiting for D. But this will not happen since they follow the order from root to the leaf So any transaction requests the locks in that order and deadlocks cannot happen 1 votes 1 votes Please log in or register to add a comment.