Hi
I have an shared application with a front and back end which is designed to book equipment to a room at a date and time specified by the user so the user will be able to create a record as follows
User 1
Item 1 room1 1/1/2011 09:00 - 1/1/2011 12:00
I have some code to check to see if item 1 is booked anywhere else between the time and dates specified above.
So if user 2 has it booked elsewhere as follows it will not allow user 1 to create the new record
User 2
Item 1 room3 1/1/2011 10:00 - 1/1/2011 12:00
So if user 1 tries to create a new booking for item 1 a message will say the equipment is already booked
I have tried to book item 1 on two machines simultaneously by clicking the book item button at the same time on both machines which resulted in a double booking of item 1 which is what i want to avoid.
Record locking will not work in this scenario because I am creating a new record (unless I am missing something )
It is pretty unlikely that two users will book exactly the same item at the exactly the same time but is there anyway i can prevent this from happening?
any help is much appreciated
Regards Phill
I have an shared application with a front and back end which is designed to book equipment to a room at a date and time specified by the user so the user will be able to create a record as follows
User 1
Item 1 room1 1/1/2011 09:00 - 1/1/2011 12:00
I have some code to check to see if item 1 is booked anywhere else between the time and dates specified above.
So if user 2 has it booked elsewhere as follows it will not allow user 1 to create the new record
User 2
Item 1 room3 1/1/2011 10:00 - 1/1/2011 12:00
So if user 1 tries to create a new booking for item 1 a message will say the equipment is already booked
I have tried to book item 1 on two machines simultaneously by clicking the book item button at the same time on both machines which resulted in a double booking of item 1 which is what i want to avoid.
Record locking will not work in this scenario because I am creating a new record (unless I am missing something )
It is pretty unlikely that two users will book exactly the same item at the exactly the same time but is there anyway i can prevent this from happening?
any help is much appreciated
Regards Phill
Comment