Exam-style question
Try this first
Explain how a lost update can occur when two clients edit the same record. Then describe how record locks could be used to manage this problem.
Model answer
What a good answer should say
- A lost update can occur when two clients read the same record before either change is saved.
- Both clients then edit their copies of the record.
- If the first client saves a change and the second client subsequently saves a different change based on the older copy, the second save can overwrite the first change.
- The first client's update has been lost.
Explanation
Why this works
The answer identifies the sequence that causes a lost update and links record locking to preventing simultaneous conflicting edits. The key point is that the lock applies to the record being accessed, rather than allowing both clients to edit it concurrently.
Common mistake
No common mistake is linked to this question yet.
