Professional Documents
Culture Documents
CC - Activity: Name: Syed Hamza Ibrar Gillani Roll No: FA-2019-BSSE-060 Submitted To: Mam Fouzia Rathore
CC - Activity: Name: Syed Hamza Ibrar Gillani Roll No: FA-2019-BSSE-060 Submitted To: Mam Fouzia Rathore
Answer:
At t1, a TX
transaction
reads account A
value, i.e., $ 300
(read only).
Time At t2, TX
transactions
deduct $ 50 from
account A
to $ 250 (only
pulled and not
renewed /
written).
Alternatively, during t3, a TY transaction reads account A value of $ 300 because TX has not
updated the value yet.
Time At t4, a TY transaction adds $ 100 to account A of $ 400 (only added but not updated /
write).
During t6, TX transaction records account amount A which will be updated as $ 250 only, as TY
has not updated the value so far.
Similarly, during t7, the TY transaction records account numbers A, so it will write as done at t4
that will be $ 400. It means that the value written by TX is lost, i.e., $ 250 is lost.
During t3, TX transactions record the updated amount in account A, i.e., $ 350.
Then at t4, TY transactions are read account A which will be read as $ 350.
Then during t5, the TX rollbacks transaction due to a server problem, and the value changes back
to $ 300 (as before).
But account A value is always $ 350 for a TY transaction as a commitment, which is the dirty
read and therefore known as Dirty Read Problem