Level 2: Data · L2.4 Transactions & isolation
Locks vs optimistic concurrency
Choose pessimistic locks or version checks for a booking system.
12 min · Pro
What you take away
- Pessimistic locking takes the row before doing the work, so conflicting transactions wait instead of failing.
And 3 more inside the class, in Pro.
How the class is laid out
- The problem
- The simple version
- The optimistic path, precisely
- Check your understanding