Shakuntala Gaur
What is optimistic and pessimistic locking?
By Shakuntala Gaur in SQL Server on Aug 08 2012
  • Shakuntala Gaur
    Aug, 2012 8

    Optimistic Locking is a strategy where you read a record, take note of a version number and check that the version hasn't changed before you write the record back. If the record is dirty (i.e. different version to yours), then you abort the transaction and the user can re-start it.

    Pessimistic Locking is when you lock the record for your exclusive use until you have finished with it. It has much better integrity than optimistic locking but requires you to be careful with your application design to avoid Deadlocks.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS