I'm setting up an online purchase system for a cooking store. They offer classes for their customers. The classes have a limited size (e.g., 20 people max). In the past, the classes have sold out in a matter of hours. So here is my concern:
Let's say Sally wants 2 seats in the Sushi class and 1 seat in the grilling class, and 1 seat in the pastry class. She adds the 2 seats in the Sushi class to her cart, then continues to the grilling class and adds 1 seat for that class to the cart, then on to the pastry class and adds a seat, then wants to check out.
It's very likely that if I wait until she checks out to "reserve" those seats for her, someone else will have purchased them. So I need to "reserve" the seats when she adds them to her cart. That's no problem. My concern is, what do I do if she doesn't check out? These seats are pulled from the class, and are now unused.
I've got ideas rolling around in my head, but I'm guessing some of you have already faced something like this, so I'm hoping you can save me some time and figuring it out.
Basically, I'm adding a record to the DB that pulls the seat when she adds it to the cart. So what do you think the best way is to double check on a regular basis (every 15 minutes or so) that Sally has completed her transaction?
Matthew