lock file only if required

Started by Thomas Bock, April 01, 2021, 02:20:06 AM

Previous topic - Next topic

Thomas Bock

During our updates we use "*dict/dd_updt;UPDATE_PHYSICAL" in order to keep the files in sync with the current DD. Every now and then that tool reports a file in use, though that file doesn't need to be converted.
Wouldd it be possible to lock the file only if there is a need to convert it?

Jane Raymond


We have looked into this issue since you first requested it last year (c.f. Wish List - *dict/dd_updt)


We analyzed both *dict/dd_updt and *dict/maint to determine if files were unnecessarily locked during the physical file update. What we found was the following:


- Files are not locked during the analysis.
- If a file does not exist and is created, it is locked when it is open. This is a non-issue, as it did not previously exist and could not be accessed by any other session. (The lock is necessary for password processing.)
- If a file exists and just requires updating the internal dictionary, it is not locked.
- If the file requires conversion, it must have exclusive access to do this as files must be renamed and erased. The file is locked to check for exclusive use, and conversion does not occur if it is not available.


No changes were required for any of the above.


One issue we did change occurs in *dict/maint:
If a file with no records is busy, the physical update was not allowed to proceed. We changed it to proceed in case just the internal dictionary needs updating, and no conversion is required.


This change will be in the 2021 release.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.