duration

Type: Character[1]

The read-only duration property of the Lock class is set to the value of the duration parameter of the lock request.

The duration parameter of the lock request specifies if the object is automatically unlocked at the end of transaction time or at the end of the current session (that is, the current thread, or process).

If a manual unlock is issued, the object is unlocked only if you are not in transaction or load state.

In persistent transaction state, all unlock requests for persistent objects are ignored. Similarly, in transient transaction state, all unlock requests for shared transient objects are ignored. A session lock is therefore not released if the unlock request is made while in transaction state. To release a session lock, the unlock request must be made while not in transaction state.

The character values correspond to the Transaction_Duration and Session_Duration global constants in the LockDurations category, respectively.

The following example shows the use of the duration property.

vars
    lock       : Lock;
    locksArray : LockArray;
begin
    create locksArray transient;
    system.getLocks(locksArray, 40);
        foreach lock in locksArray do     //access the lock entry properties
            write lock.duration.Integer.String;
    endforeach;
    locksArray.purge;
    delete locksArray;
end;