Prevents your site users from losing data by blocking the save process if the data has changed since it was loaded by the current user.
This is a very simple module that prevents your site users from losing data.
It works by blocking the save process if the data changes since it's loaded. (user1 starts editing, user 2 starts editing, user1 saves, now user2 can't overwrite user1's changes). By default, Silverstripe lets you lose data by overwriting whatever is in the database on save .
Install using composer
composer require "svandragt/silverstripe-optimisticlocking:*"
Attach the OptimisticLocking class to your data objects / page types, eg.
I keep a list of known bugs.
These are methodologies used to handle multi-user issues. How does one handle the fact that 2 people want to update the same record at the same time?
User 2 has now over-written the changes that User 1 made. They are completely gone, as if they never happened. This is called a 'lost update' and is how SilverStripe works by default.
2.Lock the record when it is read: Pessimistic locking
The lost update problem is solved. The problem with this approach is concurrency. User 1 is locking a record that they might not ever update. User 2 cannot even read the record because they want an exclusive lock when reading as well. This approach requires far too much exclusive locking, and the locks live far too long (often across user control - an absolute no-no). This approach is almost never implemented.
3. Use Optimistic Locking.
Optimistic locking does not use exclusive locks when reading. Instead, a check is made during the update to make sure that the record has not been changed since it was read. This module implements this.
Thanks to chrisrlong for the original explanation.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem