Product Documentation

c-treeRTG COBOL Edition User's Guide

Previous Topic

Next Topic

<runitlockdetect>

The runitlockdetect option specifies whether to check if a record has been locked by a separate OPEN statement issued from within the same run unit. When this option is turned on, a lock error is returned while reading a record that was locked within the same instance. When this option is turned off, reading a record that was locked within the same instance does not produce a locking error.

Accepted Values

Value

Effect

Synonyms

yes

Locks are not shared thus detect record locks. This is the default value.

y, true, on, 1

no

Locks are shared thus do not detect record locks.

n, false, off, 0

Valid <runitlockdetect> combination settings are:

<runitlockdetect>yes<runitlockdetect> (attributes anyunlock and unlockall are ignored)

<runitlockdetect anyunlock="yes">no<runitlockdetect> (attribute unlockall is ignored)

<runitlockdetect anyunlock="no" unlockall="no">no<runitlockdetect>

<runitlockdetect anyunlock="no" unlockall="yes">no<runitlockdetect>

Example (detect record locks):

<runitlockdetect>yes</runitlockdetect>


<runitlockdetect anyunlock> Attribute

The anyunlock and unlockall attributes define the unlock strategy for the shared locks therefore they are meaningful when locks are shared that is when <runitlockdetect> is set to No. When set to Yes, each OPEN instance is treated as a different run unit and locks are not shared.

The unlockall attribute defines whether the shared locks must be released by all the OPEN instances that acquired the lock, therefore it is meaningful only if <runitlockdetect anyunlock> is set to No. When set to Yes, any OPEN instance can release the shared lock.

The combinations of the anyunlock and unlockall attributes allows matching the behavior of COBOL runtimes and file systems:

  • <runitlockdetect anyunlock="no" unlockall="yes">no</runitlockdetect> - The shared lock is released when all instances that acquired the lock have release it (which mimics the Btrieve file system).
  • <runitlockdetect anyunlock="no" unlockall="no">no</runitlockdetect> - The shared lock is released when the first instance that acquired the lock releases it (which mimics the ACUCOBOL runtime).
  • <runitlockdetect anyunlock="yes">no</runitlockdetect> - The shared lock is released when any instance that acquired the lock releases it (which mimics the behavior of the Micro Focus runtime).

Example (lock released when all OPEN instances have release their lock):

<runitlockdetect anyunlock="no" unlockall="yes">no</runitlockdetect>

TOCIndex