intermediatetermWeb foundationsWeb foundations / Backend and APIs / Pessimistic Locking
IntermediateNot yet reviewed

Pessimistic Locking

A concurrency control strategy where a record is explicitly locked when read to prevent any other process from changing it until finished.

Definition

A concurrency control strategy where a record is explicitly locked when read to prevent any other process from changing it until finished.

Use case

Locking a concert ticket row using SELECT ... FOR UPDATE while a user enters credit card details to avoid double booking.

Related terms

Articles

Lock in computer science

Wikipedia · Article · link checked 2026-10-16

Lock first, ask questions later: exclusive access explained.

Suggest a change