by Carlos Mora » Sat Apr 20, 2019 5:31 pm
Hi,
File locks are not stored anywhere. They are kept in memory by the filesystem in the server OS. The dbf headers are always of the same size, they cannot change size because that is not easy to handle among several users.
In normal files, a file lock in a given region doesnt allows other users to even read that. Thats not what DBF does: You are alloed to read even a record is locked by someone else. ¿How to do that? The filesystem allows you to set locks outside the used space by the file. For locking record 1, you put a lock in the byte 1,000,000 + 1 with lenght 1. That allows the file to be read but LOGICALLY set a lock to other users. That position, starting in 1000000 in the sample. is arbitrary, and different among NTX, CDX1, CDX2, etc. In the begining, 1 000 000 may seemed ok, but now is a little bit low, falling into the real used space, so different schemes appear, that are what you see.
Reagrding your issue of lock kept after the application disconnect, it is a matter of the OS. You can inspect the Open Files in the Disk Manager and disconnect all the users that appear to have the file open even when the connection is broken. There is nothing easy to be done, except doing that manually or reboot the server.
KR