Lost update in Concurrency Control?

I have two transactions T and U, which are executed simultaneously in the database. How can I give an example of a problem with a lost update?

We can assume that we have three accounts A, B, C, and each of them has £ 100, £ 200 and £ 300, respectively.

+1
source share
3 answers

The “lost update” problem is associated with simultaneous reads and updates of data in a system where readers do not block writers. Transactions are not required to be exactly simultaneous.

  • Session No. 1 reads Account A, receives 100.
  • Session No. 2 reads Account A, receives 100.
  • Session 2 updates account A to 150 (+50) and completes transactions.
  • Session 1 updates account A to 120 (+20) and completes transactions.

, # 1 , , №2 ( "" ).

, . .

+15

(3) A 150, 100 → A 150

(4) A 120, 100 → , A 150, 100

+1

, , , , .

+1

All Articles