Notes and Study Materials

Concurrency Control With Optimistic Method

 

 

The optimistic approach is based on the assumption that the majority of the database operations do not conflict. The optimistic approach requires neither locking nor time stamping techniques. Instead, a transaction is executed without restrictions until it is committed. Using an optimistic approach, each transaction moves through two or three phases, referred to as read, validation, and write.

 

• During the read phase, the transaction reads the database, executes the needed computations, and makes the updates to a private copy of the database values. All update operations of the transaction are recorded in a temporary update file, which is not accessed by the remaining transactions.

You May Also Like:

Transaction and Its Properties
Concurrency Problems
Concurrency Control with Locking

 

• During the validation phase, the transaction is validated to ensure that the changes made will not affect the integrity and consistency of the database. If the validation test is positive, the transaction goes to the write phase. If the validation test is negative, the transaction is restarted and the changes are discarded.

 

 

• During the write phase, the changes are permanently applied to the database.

• The optimistic approach is acceptable for most read or query database systems that require few update transactions.

 

In a heavily used DBMS environment, the management of deadlocks—their prevention and detection—constitutes an important DBMS function. The DBMS will use one or more of the techniques discussed here, as well as variations on those techniques. However, the deadlock is sometimes worse than the disease that locks are supposed to cure. Therefore, it may be necessary to employ database recovery techniques to restore the database to a consistent state.

You May Also Like:


Concurrency Control With Time Stamping 

Deadlocks in DBMS

Other DBMS Questions