Is it serializable?

write(T1, balx), read(T2, balx), write(T1, balx), commit(T2), abort(T1) 

I am reviewing the exam, and this is one of the questions I looked at on breadboard paper.

According to the labeling scheme, the answer is that the transaction is serializable. But I just donโ€™t understand how.

T1 and T2 are trapped in the loop, because T1 points to T2 and then points back to T1 in the priority graph, so it does not make it serializable. Is the labeling incorrect or am I missing something?

+6
source share
1 answer

I think the main thing here is T1 abort . If I am not mistaken until the transactions are completed, I can safely assume that the disk has not been modified. This means that when T1 interrupts the state of the database, it is the same as this sequence of operations. And this is a T2 scan.

So, if we had

 write(T1, balx), write(T1, balx), abort(T1), read(T2, balx), commit(T2) read(T2, balx), commit(T2), write(T1, balx), write(T1, balx), abort(T1) 

Then the state of the database and T2 transactions will be the same as in your example. Now, if T1 commits, you'll be right in calling up the priority schedule.

+1
source

Source: https://habr.com/ru/post/945968/


All Articles