Item Locks

Item locks can be used to prevent an item from being updated by more than one process at the same time. This maintains the integrity of the database while allowing multiple users access to other items in the same group.

Proc allows a reality process to take multiple locks on the same item (this will normally occur if the item is processed by a number of different routines, each of which locks the item) - each of these locks must be separately released.

The number maximum number of item locks that can be held on the database is user-defined.

Setting Item Locks

In a Proc, an item lock is set by executing the F-UREAD command.

You cannot lock an item if it is locked by another process; F-UREAD waits until the lock is released before continuing.

An item lock can be set on a nonexistent item. When creating a new item, the item can be locked before it is written to disk. The lock can also be cleared if a write operation is not carried out.

Clearing Item Locks

Item locks are cleared by one of the following:

Note

Within a transaction, release is deferred until the transaction is completed or aborted.

Efficiency Guidelines

Transaction Handling

When using transaction handling and a transaction is in progress, the release of item locks set within a transaction is deferred until the transaction is completed or aborted. Therefore avoid the use of large transactions, particularly those started from TCL, since the holding of many locks can lead to a gradual system paralysis.

See Also

Locks and the Locking Systems.