Show that the two-phase locking protocol ensures conflict serializability,and



Download 98.23 Kb.
Page5/10
Date23.11.2021
Size98.23 Kb.
#57766
1   2   3   4   5   6   7   8   9   10
619d030b4218733a078b45dc.docx

Answer: TO BE SOLVED





    1. Devise a timestamp-based protocol that avoids the phantom phenomenon.


Answer: In the text, we considered two approaches to dealing with the phantom phenomenon bymeans of locking. The coarser granularity approach obviously works for timestamps as well. The B+-tree index based approach can be adapted to timestamping by treating index buckets as data items with timestamps associated with them, and requiring that all read accesses use an index. We now show that this simple method works. Suppose a transaction Ti wants to access all tuples with a particular range of search-key values, using a B+- tree index on that search-key. Ti will need to read all the buckets in that index which have key values in that range. It can be seen that any delete or insert of a tuple with a key-value in the same range will need to write one of the index buckets read by Ti. Thus the logical conflict is converted to a conflict on an index bucket, and the phantom phenomenon is avoided.


    1. Suppose that we use the tree protocol of Section 15.1.5 to manage concurrent access to a B+-tree. Since a split may occur on an insert that affects the root, it appears that an insert operation cannot release any locks until it has completed the entire operation. Under what circumstances is it possible to release a lock earlier?



Download 98.23 Kb.

Share with your friends:
1   2   3   4   5   6   7   8   9   10




The database is protected by copyright ©ininet.org 2024
send message

    Main page