Encyclopedia > Optimistic concurrency control

  Article Content

Optimistic concurrency control

In computer science, in the field of databases, optimistic concurrency control, (OCC) is a concurrency control method used in relational databases without using locking.

Optimistic Concurrency Control is based on the assumption that database transactions don't conflict with other transactions, and that allows OCC to be as permissive as possible in allowing transactions to execute.

There are three phases in OCC:

1. READ: Transaction executes, reading values, writing to a private sandbox.

2. VALIDATION: When transaction commits, the database checks if the transaction could have possibly conflicted with any other concurrent transaction. If there is a possibility, the transaction aborts, and restarted.

3. WRITE: If there is no possibility of conflict, the transactions commits.

If there are few conflicts, validation can be done efficiently, and leads to better performance than other concurrency control methods. Unfortunately, if there are many conflicts, the cost of repeatedly restarting transactions, hurts performance significantly.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Islip Terrace, New York

... under the age of 18 living with them, 67.6% are married couples living together, 11.5% have a female householder with no husband present, and 16.6% are non-families. 13.2% ...

 
 
 
This page was created in 24.1 ms