Product Documentation

FairCom RTG V3 Release Notes

Previous Topic

Next Topic

Possible Unexpected c-tree Error 57 Deleting a Record (loss of record lock) Fixed

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:

  1. OPEN file USING handle1
  2. READ rec1 USING handle1 WITH LOCK
  3. OPEN file USING handle2
  4. UPDATE rec1 USING handle2
  5. DELETE rec1 USING handle1

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.

TOCIndex