When using the FairCom RTG configuration option <runitlockdetect anyunlock="no">no</runitlockdetect> (or iscobol.properties option autolock_allowed=1) and not using COBOL's SELECT option "WITH ROLLBACK", an update on a record that has been locked from a different file handle unexpectedly released the lock causing a delete operation to fail with c-tree error 57 (DADV_ERR, "proper lock not held") because FairCom RTG requires records to be locked in order to delete or modify them.
For example, assume the following sequence:
Step 5 fails with c-tree error 57 because the lock acquired in step 2 has been released unexpectedly in step 4.
The lock is not expected to be released because the option anyunlock="no" should permit the lock to be released only from the same file handle. The lock is released by the automatic transaction commit that occurs during the UPDATE operation. The file uses automatic transactions because it has transaction support (c-tree file mode ctPREIMG) but it has been opened without the "WITH ROLLBACK" option.
The automatic transaction commit by default releases all the locks acquired during the transaction. However, it also releases the locks acquired on the same record using a different file handle.
This behavior has been corrected.