Hi, everyone!
In my design, the lock method was called when the user presses the Reserve button. I found a weakness in it. In network mode, if a user wants to reserve a record, the program first check if the record is being locked by someone else. If isLocked method returns ture, the program give the user a message dialog to query him/her if he/she wants to wait. I found if the user receives this dialog, he/she will never reserve the record and only see the record's owner column in the table changed by other person finally.
Is the business logic right?
If the lock method was called when the user inputs the owner ID, other persons who want to update the same record receive the message dialog and wait. Maybe the client who currently owns the lock of the record doesn't want to update it and chooses another record, then unlock the record and so in the waiting queue, there would be a client who really updates the record when he/she gets the lock. But to do so, it could generate another quesion. What if the user who owns the lock of the record, after he/she inputs half of the owner ID, the person goes out for a long time, then the record will be locked for a long time. It seems unacceptable.
Do you think what time is the best time to call the lock method?
Thanks in advance!
Regards, Ailsa Cape