Data locking

Unica Plan uses a pessimistic edit locking scheme; that is, only one user is granted update access to component instances at a time. For the GUI user, this locking is done at the visual tab level. In some cases, data is locked for a subset of an instance, for example, a project summary tab. In other cases, data is locked across many instances, for example, the workflow tab. After a user acquires a lock, all other users are restricted to read-only access to the related data.

To ensure that the changes made by a procedure to a component instance or group of instances are not inadvertently overwritten by another user, a procedure must acquire the appropriate locks before it updates component data. The execution context object that is passed to the procedure's execute() method is used to accomplish lock the data.

Before the procedure updates any data, it must call the context's acquireLock() method for each lock it needs. For example, if a procedure is going to update a project and the associated workflow, the procedure must acquire locks for both.

If another user already has a lock, the acquireLock() method throws a LockInUseException immediately. To minimize collisions, the procedure must release the lock as soon as it updates the object.

The execution manager automatically releases any outstanding locks when the execute method returns. In any case, locks are only held for the life of the database transaction. That is, locks expire if the database-specific transaction timeout is exceeded.

Note: Edit locks are not the same as database transactions.