However, if contention for data resources is frequent, the cost of repeatedly restarting transactions hurts performance significantly, in which case other concurrency control methods may be better suited.
However, locking-based ("pessimistic") methods also can deliver poor performance because locking can drastically limit effective concurrency even when deadlocks are avoided.
Optimistic concurrency control transactions involve these phases:[2] The stateless nature of HTTP makes locking infeasible for web user interfaces.
[3] Some database management systems offer OCC natively, without requiring special application code.
In such cases, the form may include a hidden field with the record's original content, a timestamp, a sequence number, or an opaque token.