Consider the following protocol for concurrency control. The database system assigns each transaction a unique and strictly increasingly id at the start of the transaction. For each data item, the database system also keeps the id of the last transaction that has modified the data item, called the transaction-id of the data item. Before a transaction T wants to read or write on a data item A, the database system checks whether the transaction-id of A is greater than the id of T . If this is the case, the database system allows T to read/write A. Otherwise, the database system aborts and restarts T.

Question1:

Does this protocol allow only a serializable schedule for transactions? If not, you may suggest a change to the protocol so that all schedules permitted by this protocol are serializable. You should justify your answer.

Question 2:

Propose a change to this protocol or the modified version you have designed for part (a) that increases its degree of concurrency, i.e., it allows more serializable schedules.

Respuesta :

Answer:

(a) yes, this protocol allows only serializable schedules for transactions as due to this the system maintains it's consistency. As in this protocol a unique transaction id is being assigned and with the help of that transaction id the system would be able to identify the process which has taken place in what particular order. For example, in case of bank transfers

balance = 1000 transaction id 100

write ADD 200 transaction id 101

write SUB 1100 transaction id 102

write ADD 900 transaction id 103

in here with the help of transaction id we can check which operation has happened in which order, if not then some operation will not happen like 102 immediately after 100 and skipping 101

(b) the modified version of this protocol would be to also consider the time of transaction and take this factor in the consideration