Pessimistic and Optimistic Concurrency Control

Pessimistic Concurrency Control
When two or more users wants to update the same record at the same time, they may end up with conflicts. Pessimistic concurrency control prevents such a situation by locking the record for the duration of a transaction to assure no conflict arises, unless deadlocks occurs.

Optimistic Concurrency Control
Optimistic Concurrency Control assumes that, When two or more users wants to update the same record at the same time, chances of conflict are very rare. And thus, allows transaction to execute without locking the resources. If there is a indication of two or more users performing updates on same record then one of the transaction is aborted.


In this sense Optimistic Concurrency Control is slightly faster then Pessimistic Concurrency Control

Leave a Reply