Intro to DBMS

Conflicts In Timestamp Protocol

Sometimes, there may be Read-Write conflicts in the timestamp ordering protocol. Let’s explain; suppose T1 is older and T2 is a younger transaction.

Case 01:

  • If an older transaction (T1) wants to perform a read or write operation before the read or write operation of an older transaction (T2) on the same data. Then there will be no conflicts.

The diagram is given below.

Note: Although Read-Write, Write-Write, and Write-read are conflicts they are never problematic in timestamp because older transaction has higher priority and always execute first than younger ones.

Case 02:

  • If a younger transaction (T2) wants to perform a read or write operation before the read or write operation of T1 on the same data. Then there will be the following conflicts
    • Read-write conflicts
    • Write-Write conflicts
    • Write-read conflicts.

Let’s explain all the above conflicts one by one.

I. Read-Write Conflict: Dirty Read Problem

Suppose younger-T2 read the value of “A” first and older-T1 abort or fail later on. Then it is a dirty reading problem.

II. Write-Read Conflict: Kind of dirty read Problem

When the younger-T2 Writes the value of data “A” first, older-T1 reads the same data and commits. But later on, the younger T2 aborts or fails. Then it is also a kind of dirty read problem.

III. Write-Write Conflict: Update Lost Problem

When the younger-T2 Writes the value of data “A” first, and older-T1 writes the same data and commits. But later on, the younger T2 aborts or fails. Then it causes a lost update problem.

Conclusion: if the younger transaction reads or writes the data (i.e., “A”) first and the older transaction wants to write or read an operation on the same data later, there must be a conflict. But keep in mind that Read-read conflict does not exist in any case.