Question

From what I read to analyze transactions the basic approach is the concept of conflict serializable.
So the database system must ensure that the scheduling of transaction is equivalent to a serializable via this approach.
But I can not see how this model works in this trivial example.
Assume the following:

T1  
READ(A)  
A = A - 50  
WRITE(A)  

and transaction 2:

T2  
READ(A)  
A = A - 50  
WRITE(A)  

According to conflict serializability only WRITE(A) are conflicting. But besides or a possible execution may be:
T1 and T2 do READ(A) concurrently. As a result each read the original value. So the final result is A - 50 and not A -50 -50 as is the outcome of a serial execution.

So from my point of view these 2 reads are conflicting (but the theory of conflict equivalency considers them non conflicting)

So I don't understand how this basic example is covered by the approach, moreover this is the standard execution in databases with REPEATABLE READ isolation level.

Was it helpful?

Solution

According to conflict serializability WRITE operation conflicts both with READ and WRITE operations. Therefore, even though each READ (A) does not conflict with the other one, it does with the WRITE (A) instruction of the other transaction. For a deeper explanation, you could consider checking "Database System Concepts", by Abraham Silberschatz et. al. The chapter 14.6 of the 6th edition should be clarifying.

EDIT: Based on what I said before, and adding that a schedule is conflict-serializable if, and only if, it can be derived from a serial one (no pair of transactions can be executed in parallel) swapping the order of pairs of instructions which are not conflicting with each other, it is evident that the effect of conflict-serializable schedules on any database will be equivalent to this of serial ones. Therefore, we can conclude that conflict serializability grants consistency.

Being that said, database managers can implement this kind of scheduling or not, with the corresponding effect on consistency of transactions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top