What Is Optimistic Locking?
Optimistic locking is a method that prevents two people from accidentally overwriting each other’s work when they edit the same record at the same time. It is called “optimistic” because it assumes conflicts are rare — it lets everyone edit freely and only checks for conflicts when someone saves.
The problem it solves
Section titled “The problem it solves”Imagine two salespeople open the same contact record at 10:00 AM:
- Alice changes the phone number and saves at 10:05.
- Bob changes the email address and saves at 10:06.
Without optimistic locking, Bob’s save would overwrite Alice’s phone number change — because Bob’s copy still had the old phone number. Alice’s update is silently lost.
How it works
Section titled “How it works”Every record has a version number that increases each time someone saves. When you open a record, the CRM remembers which version you started with. When you save:
- The CRM checks: “Is the version in the database still the same as when this person opened the record?”
- If yes — Your changes are saved, and the version number goes up by one.
- If no — Someone else saved first. The CRM tells you about the conflict instead of blindly overwriting.
What happens during a conflict
Section titled “What happens during a conflict”When HARi detects a conflict, it does not simply reject your changes. It compares what you changed against what the other person changed:
- If you edited different fields — Both changes are merged automatically. No data is lost.
- If you edited the same field — You are shown both versions and asked to choose which one to keep.
Why it matters
Section titled “Why it matters”Optimistic locking means your team can work on the same records without fear of losing each other’s updates. It is especially important when multiple people manage the same accounts or deals.
Learn more: What Is an Audit Log?