liveBook · Manning

Optimistic locking

A concurrency-control technique that detects conflicting updates by validating a version or equivalent state when changes are applied, rather than preventing concurrent access in advance.

How 2 Manning books explain it

Java Persistence with Spring Data and Hibernate epub

Optimistic locking detects conflicting concurrent modifications by checking an entity version or equivalent state rather than acquiring exclusive locks in advance.

How it is used
Detects conflicting changes during concurrent transactional work.
How deep it goes
Identifies versioning and places it in isolation-level decisions, but defers its detailed treatment.
Examples
Uses a diagram of two transactions updating the same data without isolation.
What you can do after
Evaluate/understand versioning as one consideration when choosing an isolation level for concurrent application work.

Read how Java Persistence with Spring Data and Hibernate epub explains optimistic locking →

Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Optimistic locking is a concurrency-control technique in which an update succeeds only when the item's supplied version matches its current version.

How it is used
Protects DynamoDB items from stale concurrent updates in a fault-tolerant web service.
How deep it goes
Defines version checks, walks through concurrent updates and retries, and notes overhead without detailing retry implementation.
Examples
Uses two processes reading version 0, one advancing to version 1, and the other retrying after rejection.
What you can do after
Apply it via DynamoDB conditional updates and retry rejected changes after rereading the item.

Read how Amazon Web Services in Action, Third Edition: An in-depth guide to AWS explains optimistic locking →

Related concepts

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.