in reply to Re: Implementing rowlocking in thread Implementing rowlocking
Most commercial systems I've worked with implement this in a much simpler manner: by simply adding a datestamp to the row in question.
When you render the edit form, include the datestamp as a hidden field.
When the user submits the update, compare the datestamp with the one in the row. If the row contains a newer one, there's a overwrite issue. Ask user to confirm they want to overwrite, maybe give them some idea what's changed.
Bonus points for using ajax to notify open clients of the row change while they're editing the records.
I think this is orders of magnitude simpler than your attempt to reinvent client/server locking behavior in the browser (which might just be a first - which should scare you), and it's backed up by lots of prior art, so you know it will work.
|