Two tabs, the same seats: who owns the hold?
transcript
You open two tabs. Same show. Same seats, A2 and A3. One tab is stale. Which one gets to book?
Paying takes up to 10 minutes. You can't hold a lock that long. So the seats get a hold. They belong to an owner. Until a set time. Then they're simply free again. And the hold is checked again when the payment arrives.
Each booking is born held. Its seats are locked. Confirmed only if the hold is still its own. Paid too late? Expired, and refunded.
Here's the real question. Who owns the hold? You, the user? No. The booking. Each attempt gets its own booking id.
Tab 1 holds A2 and A3, as booking BK00001. Tab 2 tries the same seats. New booking, new owner. Refused. Ten minutes pass. The first hold expires. Tab 2 retries, and gets them. Now tab 1's payment lands. Its hold is gone. Expired, and refunded.
If the user owned the hold, both attempts would look identical. The stale tab could confirm the newer attempt's seats. Owned by booking id, each attempt touches only its own seats.
A hold belongs to an attempt. Not to a person.
Full breakdown in the lecture.