LOCK

Control record locking

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
LOCK:lock_spec

Arguments

lock_spec

One of the following identifiers or corresponding ­values: (n)

Q_NO_LOCK or 0

Do not lock the record.

Q_AUTO_LOCK or 1

Perform automatic locking on the record. (default)

Q_MANUAL_LOCK or 2

Perform manual locking on the record.

Q_NO_TLOCK or 3

Do not lock the record or probe the index tree.

Discussion

The LOCK qualifier specifies whether the operation requires a record lock.

Manual locking is similar to automatic locking, except that manual locking blocks all update reads until either the channel is closed, an explicit ­UNLOCK with the RFA qualifier specified is performed, or the FREE subroutine is called.

Note

On Windows and UNIX, manual record locking is available only for ISAM files. If you specify a manual lock on a relative (or other) file, an automatic lock will be applied.

OpenVMS allows manual locks on RMS ISAM and relative files.

Q_NO_LOCK allows you to READ a locked record when it’s opened in update mode. The read record is not locked.

On Windows and UNIX,

Q_NO_TLOCK and Q_NO_LOCK are synonymous on OpenVMS systems.

On the OPEN statement for both non-ISAM and ISAM files, the Q_NO_LOCK and Q_AUTO_LOCK are the only valid options for the LOCK qualifier.

On the STORE statement, Q_NO_LOCK and Q_MANUAL_LOCK are the only valid options for the LOCK qualifier.

See also