~/ learn/ comp-378/ cards/ Concurrency Control I: Locking (Pessimistic)
1 of 3

Describe the lost-update problem and how locking solves it.

Describe the lost-update problem and how locking solves it.

Answer

Two transactions read the same value, each updates it independently, and the second write overwrites the first — the first update is lost. Locking solves it by making the first transaction take an exclusive lock before reading; the second is blocked until the first commits, then reads the updated value.

It is the canonical reason concurrency control exists: an unguarded read-then-write race silently erases an update.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/a94947f0-d132-45dc-b5b3-be4502240028/flashcard utf-8 LF