PRODUCT : Paradox Engine NUMBER : 1002 VERSION : All OS : All DATE : October 19, 1993 PAGE : 1/1 TITLE : Lock File Contention Lock file contention is caused when many users attempt to use a single table at the same time in a tight and repetitive loop. When the Engine opens a table, it attempts to place a PFL (Prevent Full Lock) on the table. To do this, the Engine must access the table's lock file. The Engine detects a Lock by opening the lock file and scanning it from beginning to end. Each entry in the lock file is checked for potential conflicts with the lock that the Engine is attempting to place. A problem arises when the lock count for a table drops to zero. When the count reaches zero, the Engine deletes the lock file for the table. However, under MS-DOS, in order to delete a file, the file must be closed. So the Engine closes the table's lock file and then attemps to delete the file. However, another user can (re)open the file in the meantime ( i.e. after our user closes the lock file but before the file can be deleted ). Thus, our user is on hold waiting for the file to be closed before the deletion can succeed. If the lock file is not closed for a long time, the user is effectively locked up and unable to do anything. To avoid the stalled situation, tables should not be opened and closed in a tight loop. Under Windows, the Paradox Engine optimizes the locking necessary between applications running in different windows but sharing the same DLL. If two or more such applications share the same table, and the table is on the local disk (not stored on a networked disk), the lock files are kept entirely in memory and are never created on disk. If there is memory corruption, the state of the locks might be disturbed. The problem should disappear if the optimization is turned off by selecting "Share Local Tables" in the configuration utility, PXEngCfg.EXE. DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.