Optimistic Locking
Version 1.0.0 · Updated 2026-07-28
CORE DEFINITION
In relational database management systems, optimistic concurrency control (also known as "optimistic locking", abbreviated as "OCC") is a concurrency control method. It assumes that multi-user concurrent transactions will not affect each other during processing, and each transaction can process the part of data it affects without generating locks. Before committing data updates, each transaction first checks whether other transactions have modified the data after it was read. If other transactions have updated it, the committing transaction will roll back. Optimistic transaction control was first proposed by Professor H.T. Kung. Optimistic concurrency control is mostly used in environments with low data race and few conflicts. In such environments, the cost of occasionally rolling back transactions is lower than the cost of locking data when reading, thus achieving higher throughput than other concurrency control methods.
SCAFFOLDING EFFECT
Reduce cognitive load
In relational database management systems, optimistic concurrency control (also known as "optimistic locking", abbreviated as "OCC") is a concurrency control method. It assumes that multi-user concurrent transactions will not affect each other during processing, and each transaction can process the part of data it affects without generating locks. Before committing data updates, each transaction first checks whether other transactions have modified the data after it was read. If other transactions have updated it, the committing transaction will roll back.
Anchor fast decisions
Database concurrency control: assumes few conflicts, no locking when reading, and checks at commit time whether the data version/timestamp has been modified by others. If modified, conflict and retry. The mechanism is to replace "pre-locking" with "detect conflict + retry", significantly reducing blocking and improving throughput in read-heavy, write-light scenarios.
MINIMUM ACTION
In progress 0/5Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E4%B9%90%E8%A7%82%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6verified
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS