Because the Google database does support transactional updates, you could pre-create all possible time slots at all possible clubs, and have a property on it saying who has booked it. Set it to NULL initially to show that it's not booked. Then, just select the set of bookings that are at the right time, with a "booker" of NULL. When updating, your transaction will fail if someone else has stolen the booking in the meanwhile, and the user has to go back and try again. (Also known as "level 8 retry" :-)
I could be wrong, but that's how I understand it should work. It's up to you to make sure that old bookings get purged, and new possible bookings get created enough ahead of time from some authoritative source, and also to make sure there are no duplicated "possible bookings" for a given court at a given club. On Nov 5, 4:09 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > I think this is the last question I need answered in order to see if GAE can > do what I need. > > Imagine a database of sports clubs all of which have customers for tennis > courts > > My idea is that I have > > Club > Customer > Booking > Court > > where a booking has a reference to the court and the customer and the club, > and also holds the date and time of the booking (just the hour to make > things simple, and we'll assume all bookings are an hour long) > > Two things: > > a) Is this evil 'old' thinking and I should be doing something else? > > b) If not, then how would I find out if there were a free tennis court > somewhere in any of the clubs at a certain time and on a certain date? > > It's easy enough to find existing bookings on that day and at that time, but > how do I find a court without a booking? > > I believe it is not possible to retrieve all the courts and get rid of the > ones with bookings because there will be more than 1000 courts in the > system. > > Can anyone help me out please? > > Thanks > Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---