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:
Example (lock released when all OPEN instances have release their lock):
<runitlockdetect anyunlock="no" unlockall="yes">no</runitlockdetect>