I am finsihing (meaning i didn't start this mess) and order entry application for a small company. The app uses a MYSQL database and tracks orders on a life cycle. My problem is the order data doesnt become static (in the app) until a clerk has verified the data. The order sits in a screen queue where many orders may pile up. Several cleks could potentially access the open order at the same time and both make an attempt to confirm and modify the data. I obviously need to lock the order once a clerk accesses it.
My initial thought is to have a boolean ebtry in the table for the lock status. Once the clerk access the open order set the lock=1. Once the data has been verified and submitted then set lock=0.
The problem is if the broswer terminates of one of the 10 menu options are used after accessing the open order or the machine crashes the order will remain locked.
So then I thought maybe add the session user name to the table as well while lock=1 then at least the same clerk can come back in and access it or the admin can log in as that user and fix it.
Is there an easier way?