Other locking scenarios
Apart from the complex general use case described in the Editing Objects with Pessimistic Locking topic, there are some other locking scenarios which a user may come across.
1. Locked by himself
Use case scenario: User B wants to work on an object but it is locked by himself.
The following stages:
When a user opens the object, a message about the locking situation appears.
Using the Yes, No and Cancel buttons, the user can take over that lock to edit the object, not take it over and open it in the read-only mode or not to open it at all.
2. Expiring lock
Use case scenario: User B is the owner of the lock, which means he works on the object exclusively. The lock is going to be expire.
The following stages:
Shortly before the lock expires, the user B receives a message indicating that the lock will be removed in x minutes. See also the workflow described in Global Settings.
3. Lock conflict
Use case scenario: User B locks an an object. The lock expires but he still continues working on it. A user C opens that object and starts working on it (becomes a new lock owner). User B is going to save his modifications while the lock exists for the other user C.
The following stages:
An error message with the info about the real locking situation and what to do now appears to user B.
The error message example: "Unfortunately the data cannot be saved. The editor has been opened for too long. The object lock time had expired in the meantime and the data was modified by another user".
4. No lock
Use case scenario: User B locks an object. The lock expires or a permitted user deletes the lock but the user B still continues working on it. A user C opens that object and starts working on it (becomes a new lock owner). User C changes some data, saves it and closes the object. There is currently no lock for that object. Now User B is also going to save his modifications but without having the lock for it.
The following stages:
An error message with the info about the current locking situation and what to do now appears to user B.
5. No lock II
Use case scenario: User B locks the object. The lock expires or a permitted user deletes the lock but user B still continues working on it. A user C opens that object, becomes a new lock owner and starts reading the data in the edit mode. The User C does not modify any data but closes the editor. There is currently no lock for that object. Now User B is also going to save his modifications but without having the lock for it.
The following stages:
No message is displayed because because saving the data is fine even if there is no User's B lock on that object.