Menu

Lock a record based on user access

+2 votes

We should like to be able to lock a record if being viewed / edited in the application so that if another user pulls the record 1) they are alerted to the fact that the record is being accessed 'elsewhere' and 2) that they are unable to edit or click buttons that write back to the database.

in Features (Done) by (220 points)
recategorized by

4 Answers

+1 vote
 
Best answer

DONE: Solution #4 - OnEdit

OnEdit locking leaves the records unlocked until the moment that a user starts to edit it.

As soon as an edit operation is attempted then the record would be locked.

This functionality was added in dbFront v1.1.0.1978

by (65.1k points)
selected by
+1 vote

DONE: Solution #1 - OnEnter

This functionality was completed in dbFront version 1.0.10

For more details on the Record Locking implementation see: Record Locking.

by (65.1k points)
edited by
+1 vote

REJECTED: Solution #2 - Write Locking

An alternative solution would be to allow all users to edit a record but only allow the first save to complete. Any subsequent saves to the same record would be blocked. Users that encounter a blocked save could then be given details about the changes with some option to merge their changes.

Extra functionality could be added to alert other users as soon as one user has started editing the record they are viewing/editing.

I have decided to REJECT this idea because it would be too complicated and it would annoy users since they would not find out about a locking issue until after they had put in their effort to edit the record.

by (65.1k points)
edited by
Of the three options you have suggested, this seems to be the least intrusive as it would only kick in when an update is initiated. I'd even suggest that it is "slimmed down" to remove the giving of details about changes made by other users and simply send a message to the other users saying something like "this record has been changed by XXXXXX since you accessed it - please re-load to see new contents". It's then up to the user to determine what to do.
However, this raises the question of whether this should apply to just the table being edited or to all of the possible Main/Child "transaction" saves as you described them in  Version 1.0.8.2763.
Regards
Colin
Hello Colin, what you suggest should be covered by the #4 OnEdit solution added in dbFront 1.1.0.1978
0 votes

REJECTED: Solution #3 - Explicit Locking

Optionally specify that a table should be managed via Explicit Locking.

If set then dbFront would lock that record for all users but allow users to request an explicit lock if they wanted to edit a record.

If a lock was requested and granted then all other users would be prevented from editing that same record.

The risk that a user might lock a record and then step away would be relatively minimal.

I have decided to REJECT this idea because it would be too complicated and there did not appear to be any interest.

by (65.1k points)
edited by
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
 |
Powered by Question2Answer
...