liveBook · Manning

Lost update anomaly

A lost update anomaly is a concurrency error in which one modification to shared data overwrites or fails to incorporate another modification.

How 3 Manning books explain it

Java Persistence with Spring Data and Hibernate epub

A lost update occurs when one concurrent transaction overwrites another transaction's committed modification without detecting the conflict.

How it is used
Uses lost updates to explain the consequences of weakened transaction isolation and motivate concurrency control.
How deep it goes
Traces competing reads and writes, then shows version checking at flush and limitations of dirty-property checks.
Examples
Uses competing buyNowPrice changes and a versioned Item update that throws an OptimisticLockException.
What you can do after
Apply optimistic concurrency control through Java Persistence versioning to detect conflicting updates.

Read how Java Persistence with Spring Data and Hibernate epub explains lost update anomaly →

Microservices Patterns, Second Edition

A concurrency anomaly in which one update overwrites another update made from the same previously read data without detecting the conflict.

How it is used
Diagnoses how concurrent sagas can produce inconsistent outcomes despite correctly implemented local transactions.
How deep it goes
Defines the overwrite conflict and illustrates its consequences in concurrent sagas without detailing a prevention procedure.
Examples
Uses concurrent Create Order and Cancel Order sagas, where an overwrite accompanies credit being released without reservation.
What you can do after
Understand how concurrent saga execution can overwrite updates and violate business invariants.

Read how Microservices Patterns, Second Edition explains lost update anomaly →

The Coder Cafe

A lost update is a concurrency anomaly in which one transaction's write overwrites another transaction's write based on an earlier shared value.

How it is used
Diagnoses incorrect results from concurrent transactions that overwrite one another’s updates.
How deep it goes
Defines the anomaly, traces it through a banking scenario, and explains snapshot-isolation conflict handling.
Examples
Uses concurrent deposits into Alice’s bank account, producing $200 instead of the expected $300.
What you can do after
Evaluate isolation levels for preventing lost updates while balancing consistency guarantees against concurrency performance.

Read how The Coder Cafe explains lost update anomaly →

Also covered in

What to know first

Related concepts

Questions about lost update anomaly

What is lost update anomaly?

A lost update anomaly is a concurrency error in which one modification to shared data overwrites or fails to incorporate another modification.

Which Manning books explain lost update anomaly?

Java Persistence with Spring Data and Hibernate epub, Microservices Patterns, Second Edition and The Coder Cafe.

What should I know before learning lost update anomaly?

Manning books that teach lost update anomaly usually introduce thread and database transaction first.

What is lost update anomaly a kind of?

Lost update anomaly is a kind of serialization anomaly. A serialization anomaly is an outcome of concurrent operations that cannot be explained by any serial execution order.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.