207 views

1 Answer

0 votes
0 votes

Assuming transactions do not unlock items until commit. So when T2 writes X, it upgrades the lock to exclusive lock. When T1 want to write, it cannot acquire exclusive lock for X, so the schedule is not allowed.

Applying time stamping algorithm on the schedule,

From the schedule TS(T1) = 1, TS(T2) = 2, TS(T3) = 4, write_TS(X) = reas_TS(X) = 0

T1: R(X)- since TS(T1) > write_TS(X), executes read, set read_TS(X) = TS(T1) = 1

T2: W(X) - since  TS(T2) > write_TS(X) and TS(T2) > read_TS(X), executes write, set write_TS(X) = TS(T2) = 2

T1 : W(X) - since TS(T1) < write_TS(X), abort and rollback

Thus option D.

No related questions found