What’s difference between “Optimistic” and “Pessimistic” locking?

 Posted by ArticlesMaint on 9/17/2009 | Category: ADO.NET Interview questions | Views: 10579

In pessimistic locking when user wants to update data it locks the record and till then no one can update data. Other user’s can only view the data when there is pessimistic locking.

In optimistic locking multiple users can open the same record for updating, thus increase maximum concurrency. Record is only locked when updating the record. This is the most preferred way of locking practically. Now a days in browser based application it is very common and having pessimistic locking is not a practical solution.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response