Write locks
Understand how write locks prevent you from overwriting changes made to data from other sources.
Read time 1 minuteLast updated 2 days ago
Write locks ensure that when you update a data item, you can't overwrite changes from somewhere else. For example, if there are changes in a different part of your code, or from a Cloud Code script. For an example of how to use a write lock, refer to the
SaveItemEnforces conflict checks
Read and write commands both return awriteLockwriteLockConflict resolution
If you encounter a write lock error, you can proceed with one of the following:- If you're certain the value you want to save is correct, you can bypass the write lock to overwrite any changes.
- To update the value and write lock from the Cloud Save service, read the value again. You can then manually resolve the conflict.
Write lock omission
Item creation
To avoid unnecessary errors, you need to omit thewriteLockOverwrite changes
To skip write lock validation, you can set thewriteLocknull