Pessimistic Locking
A concurrency strategy that acquires locks before conflicting operations are allowed to proceed, prioritizing prevention over later conflict detection.
Database Context
Pessimistic locking prevents conflicting work by acquiring locks before a protected operation proceeds. Mechanisms such as SELECT ... FOR UPDATE can keep critical rows locked for the life of a transaction, making lock order and transaction duration important to deadlock risk and tail latency.
Invariant Boundary
A row lock does not automatically protect an entire business invariant. Predicate conditions, multiple records, or external resources may require a broader concurrency design.
Related Database Concepts
- Deadlock
- Transaction
- Optimistic Locking
- Lock Contention