Encyclopedia > Timestamp-based concurrency control

  Article Content

Timestamp-based concurrency control

In computer science, in the field of databases, timestamp-based concurrency control is a non-lock concurrency control method, used in relational databases to safely handle transactions, using timestamps.

Each transaction can be assigned a timestamp at startup, so we can ensure that if an action Ai of a transaction Ti conflicts with action Aj of a transaction Tj, action Ai occurs before action Aj if TS(transaction Ti) < TS(transaction Aj). If an action violates the order, the transaction is aborted and restarted.

Every database object O is given a read timestamp RTS(O) and a write timestamp WTS(O).

If a transaction T wants to read O, and TS(T) < WTS(O), the order of the read with respect to the most recent write on O would violate the timestamp order between transaction and writer. So, T is aborted and restarted with a new, larger timestamp. If a transaction T wants to read O, and TS(T) > WTS(O), T reads O, RTS(O) is set to max[RTS(O), TS(T)].

If a transaction T wants to write O, if TS(T) < RTS(O), the write action would conflict with the read action of O and T is aborted and restarted.

If a transaction T wants to write O, if TS(T) < WTS(O), we use the Thomas Write Rule and ignore this write to O and continue.

Otherwise, T writes to O, and WTS(O) is set to TS(T).



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Holtsville, New York

... of it is land and none of the area is covered with water. Demographics As of the census of 2000, there are 17,006 people, 5,316 households, and 4,454 famil ...

 
 
 
This page was created in 40.3 ms