About Concurrency
Many of the methods of the %Persistent class allow you to specify an optional concurrency setting in order to determine how locks are used for concurrency control.
The possible concurrency settings are:
0:No Locking No locks are used.
1:Atomic When an object is loaded, the %LoadData method will create a shared lock for the object provided the object occupies more than one storage node in the database. No locks are held for objects stored in a single node. The lock is released by %LoadData when it is done loading the object. When an object is initially saved to the database (inserted), %SaveData will hold an exclusive lock during the course of the save provided the object occupies more than one storage node in the database. %SaveData holds no locks for objects stored in a single node.
When a previously saved object is saved to the database (updated), %SaveData will hold an exclusive lock during the course of the save.
2:Shared When an object is loaded, %LoadData will create a shared lock for the object. The lock is released by %LoadData when it is done loading the object.
When an object is initially saved to the database (inserted), %SaveData will hold an exclusive lock during the course of the save provided the object occupies more than one storage node in the database. %SaveData holds no locks for objects stored in a single node.
When a previously saved object is saved to the database (updated), %SaveData will hold an exclusive lock during the course of the save.
3:Shared/Retained When an object is loaded, %LoadData will create a shared lock for the object. The lock is released by %Close() when the object is removed from memory.
When an object is initially saved to the database (inserted), %SaveData will hold an exclusive lock during the course of the save provided the object occupies more than one storage node in the database. %SaveData holds no locks for objects stored in a single node.
When a previously saved object is saved to the database (updated), %SaveData will hold an exclusive lock during the course of the save.
4:Exclusive When an object is loaded, %LoadData will create an exclusive lock for the object. The lock is released by %Close() when the object is removed from memory.
When an object is initially saved to the database (inserted), %SaveData will hold an exclusive lock during the course of the save provided the object occupies more than one storage node in the database. %SaveData holds no locks for objects stored in a single node.
When a previously saved object is saved to the database (updated), %SaveData will hold an exclusive lock during the course of the save.