You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.
Christopher Bennage edited this page Jan 30, 2015
·
1 revision
Locking Strategies
These are stategies to handle contention for resources.
There are two general models to deal with these situations that you can observe in the wild:
Pessimistic. You take a time-bombed lock on an object and reserve it for the client. Ticketmaster operates their web site that way. When they show you a set of seats tickets they are yours until the clock ticks down.
Optimistic. There's no lock. Expedia/Orbitz work that way. When they show you a seat, you don't get it until you book it and there is no promise made.
That said, 1 isn't the only way travel agents work. You can absolutely call your airline and ask them to do 1 for you and they'll give you 24h (or longer with status) to consider whether you actually want the ticket.
_All expected state transitions in these two models are not failures, meaning that if you try to book a seat in model 2 and someone beats you to it, that's just a normal outcome of the optimistic strategy.