Hi Experts,
I am creating a web application which has a few management screens, where a user can go to edit records (for example, changing the contact details of a user). Access to these managements screens are controlled by roles, with multiple users possibly having access. The problem now arises of what to do if two users simultaneously try to edit the same record.
My problem is with the front-end, not with the back-end. What are some of the patterns I can use in order to design my pages so as to be both user-friendly and prevent concurrent modifications? The only two options I can think of are these:
- Pessimistic locking: Difficult in a web environment where I'd need to wait for the session to timeout before being able to release the lock in most cases.
- Optimistic locking: Not that good in terms of user-friendliness, as a user might fill in a large form only to be greeted with a "cannot save" message at the end.
Any suggestions?