Database Theory: What is Optimistic Locking and Pessimistic Locking?

Pessimistic Locking: This is a standard locking like an Exclusive lock or Shared lock. The reader is blocked by writer and writer is blocked by the reader. SQL Server Isolation levels like Read Committed, Repeatable Read, Serializable are mostly doing Pessimistic Locking. It locks the transaction whenever something is going wrong and it puts the … Continue reading Database Theory: What is Optimistic Locking and Pessimistic Locking?