Locking records

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 13, 2009   (RSS)

I know that because HTML is stateless, it's not possibly to lock records as such, but have come across situations recently where two people have been editting the same record during the same period so that when they both save their changes, the second person to save overwrites the first person's changes.

Have you given any thought to this area?

The solutions I have thought of are setting a flag somewhere to say the record is 'locked' so that if somebody attempts to edit it, they are either not allowed, or at least get a warning showing them that 'userX' is currently editting this record so that they can then contact 'userX' to confirm. Every so often, say every hour, a process could check for dormant locks and unlock them based on a parameter. Or, there could be an AJAX process in the editor that updates the lock every minute or so and if the lock hasn't been updated within the last minute, then a second editor will assume that the lock is redundant.

It would be great to include this at some point in the future, but please let me know if I'm way off the mark.

Thanks, Paul.