
To prevent the simultaneous modification of resources, the repository framework implements locks. The locks enable the framework to serialize access to resources and thus prevent the loss of data resulting from parallel updates.
If an application wants to apply a lock, it issues a lock request for the resource and the user. If there is no other blocking lock on the resource, the application can obtain the lock. If a blocking lock already exists, the request is denied. Access of a particular kind, for example, read or write, is only allowed for users who obtain the relevant lock.
The behaviour of locks is controlled by the following characteristics:
A shallow, exclusive write lock prevents all other modifying access and blocks all other write locks, but allows further read locks. If a collection is locked all operations which modify the list of children, including the creation of children, are also locked.
Once an application holds a lock on a resource, it cannot lock the resource again. Therefore methods are available to check whether a lock already exists and to find out the user to whom it is assigned. If the lock has a timeout, the application must refresh the lock to extend the timeout and not relock the resource.
See also: