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
David McReynolds

... Peacemaker"]] - Article by Paul Buhle: Nonviolent Activist. 1999, May 01 - "Annual Dinner And Peace Award Ceremony: A Celebration Of David McReynolds" - Pamphlet: War ...

 
 
 
This page was created in 23.4 ms