PxPlus User Forum

Twitter Twitter Twitter

Author Topic: lock file only if required  (Read 158 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 138
    • View Profile
lock file only if required
« on: April 01, 2021, 02:20:06 AM »
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

  • Staff
  • Diamond Member
  • *****
  • Posts: 250
    • View Profile
    • PVX Plus Technologies
Re: lock file only if required
« Reply #1 on: April 01, 2021, 09:25:12 AM »

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.