On May 31, 11:10 pm, pbreit <pbreitenb...@gmail.com> wrote: > I wouldn't worry too much about it. As long as you check for its > availability immediately before assigning it to a traveler, you'll be fine. > Then you'll need to run a periodic job to release pending reservations that > do not complete.
But I am not that confident about it. Allow me to quote some word from [1]. "I was able to exploit this race condition and create two identical user records in SQLDB (In test environment, I had to add a small time.sleep(), but in real world such problems DO happen - for example when server load is higher)." And, in case of [1], there is a last ditch, duplicated record can be denied if our db has a unique=True constraint. But in my booking system case, no constraint can help. User Bob can overwrite user Alice's booking, and we don't even have an easy way to detect and repair that. :-/ [1] http://groups.google.com/group/web2py/browse_frm/thread/679f353e4dd10982