Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider concurrent execution of two transactions \(T1\) and \(T2\) in a DBMS, both of which access a data object \(A\). For these two transactions to not conflict on \(A\), which one of the following statements must be true?

  • A.Both \(T1\) and \(T2\) only read \(A\)
  • B.\(T1\) reads \(A\) and \(T2\) writes \(A\)
  • C.\(T1\) writes \(A\) and \(T2\) reads \(A\)
  • D.Both \(T1\) and \(T2\) write \(A\)

Answer: A

The transactions do not conflict only if both T1 and T2 only read A.

Two operations on the same data item conflict when they belong to different transactions and at least one of them is a write. Reads alone can be done in any order with the same result, so two reads never conflict.

Each of the other three cases involves a write: T1 reading and T2 writing gives a read-write conflict, T1 writing and T2 reading a write-read conflict, and both writing a write-write conflict. In all three, swapping the order can change what is read or what value is left in A.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.