I am creating an app on the Seating Management for our offices. Admin can set number of seats for any specific location and employee can book that many number of seat (first come first serve basis)
Now in order to ensure there is no overbooking, I am doing the following,
- Check Office Capacity value that Admin has configured
- Check already booked record count for one particular day
- Subtract (1-2)
- If 3 is greater than 0 then only I am allowing new entries, so far so good.
Now the issue arises when multiple users are accessing the App simultaneously.
Assume only 1 place is left for the location and 3 users are accessing the App simultaneosuly. All 3 will see 1 place left and can book the same as there is no validation happening on Actual Save (Submit) form event.
Any thoughts on how to resolve this?
For Tech-Savvy friends : ‘How to avoid race condition in Appsheet?’