what is database optimistic locking
Optimistic vs. Pessimistic locking. 1  Optimistic Locking is a strategy where you read a record, take note of a version number (other methods to do this involve dates, timestamps or checksums/hashes) and check that the version hasn't changed before you write the record back.