Keep the list of available campsites in an app-scoped array. When someone searches for available campsites, loop over the array and release the locks on all pending but uncompleted transactions over X minutes long. Then output the result.
You'll also need a check so that if someone reserves a site after this list has been output to screen but before the current user clicks 'reserve it for me' themselves, the system can handle this. The risk of race conditions with this is here for the reads and db updates. I'd think using a single named lock around both the array reads, writes and db updates would be necessary to ensure integrity. -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201267 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54