Given the following two transactions,order the operations within these transacti
ID: 3608446 • Letter: G
Question
Given the following two transactions,order the operations within these transactions in order todemonstrate the following problems of Lost Updates and Dirty Read.Indicate the wrong value of x, and the correct value of x for theoffending operation or output.
T1
T2
read(x)
read(x)
x _ x+ 1
x _ x+ 1
write(x)
write(x)
read(x)
x _ x+ 1
abort(T1) orcommit(T1)
write(x)
commit(T2)
T1
T2
read(x)
read(x)
x _ x+ 1
x _ x+ 1
write(x)
write(x)
read(x)
x _ x+ 1
abort(T1) orcommit(T1)
write(x)
commit(T2)
Explanation / Answer
T1
T2
read(x)
x _ x+ 1
write(x)
read(x)
x _ x+ 1
write(x) //here lost of x occur, written by T1
x _ x+ 1
write(x)
commit(T2)
T1
T2
read(x)
x _ x+ 1
write(x)
read(x) //It is dirty read, as previous x will belost because of T1 abort.
x _ x+ 1
write(x)
x _ x+ 1
write(x)
commit(T2)
T1
T2
read(x)
x _ x+ 1
write(x)
commit(T1)
read(x)
x _ x+ 1
write(x) //here lost of x occur, written by T1
x _ x+ 1
write(x)
commit(T2)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.