Thursday, March 29, 2012

Can I have SQL server clear a value after a certain amount of time?

I have an application that allows users to "reserve" a certain time and location for practice sessions. I want them to look at a web form that shows which times are available and then allows them to select an open slot and then submit this form with some personal information. My problem is that as soon as they select an open slot, other users should see that this slot is no longer available. On the other hand, if someone selects an open slot and then takes too long to type in their personal information, I want it somehow to kick them out and re-open this slot back up.

I know that I can create a field called 'status' in my database that gets turn to something like 'pending' as soon as the first user clicks on an open slot, but how would I turn this field back to the 'open' state if the user took too long to enter their data?

Any help would be surely appreciated.

Cheers,
AzFyou can store the time the page was requsted in some variable and check against some preset time like 5 min or 10 min...also when do you set the slot as reserved...as soon as the user clicks on the spot or at the end of the page after the user finished entering all the info...? i would suggest doing the latter...

hth

No comments:

Post a Comment