Prevent a double booking under concurrency
Mid · practical lab · 35 min · runtime php-cli
Brief
Two requests try to reserve the same slot at the same time. Describe how to wrap the check-and-insert in a transaction with a lock so only one succeeds, and explain the failure you are preventing.
3 progressive hints are available in the editor.
Public checks
- identifies race — expected:
mentions check-then-insert race