• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1679
  • Last Modified:

Lockfile has grown too large

Hi there,

I am developing a multi-user application with Paradox tables.

Somehow I will get the error message "lockfile has grown too large" when the application has been used for some days. Even when the application has been ended and restarted the lockfile will still be filled and result into the above-mentioned error message again (after a while).

How can I empty this lockfile within my program?
And what is the reason for this?

Thank you.

1 Solution
From experience, Paradox and Multi-user in the same sentence are bad news.  Use Interbase or it's free open-source descendent/clone (Phoenix ??) to gain speed, reliability, and security.

Paradox lock files are destroyed once all users have cleanly exited the application.  If the files are not being destroyed when there are no more users logged in then you can expect all sorts of other data corruption as well.

Lock file sizes used to be configurable at database creation time.

Since paradox is managed from the client PC rather than from the server, a common place to record record and table locks is required.  

Locks are required so that two people don't overwrite each others work at the same time.  The lock may say "I own this record and you can't touch it" (exclusive lock) or "I own this record but you can read it" (read lock) or any other position in between.  Locks may also apply to entire tables.

The lock file (*.lck) serves as a central repository for this purpose when each client is performing the entire database management thing.

A DBMS server such as Interbase removes the workload of maintaining the locks from your client application and places that in a single application where is is more efficient (no I/O).  

It also buys you reliability - if your app fails then the DBMS will detect that the connection has been lost and perform any clean up.  If a Paradox app fails, then your tables and indeces will be corrupted.
Read this Technical information:

Removing "Lock file has grown too large" Error - by Borland Developer Support Staff

    Technical Information Database

   TI256B.txt   Removing "Lock file has grown too large" Error
   Category   :General Programming
   Platform    :All
   Product    :BDE  All

   Lock file has grown too large, Decimal:9495 Hex:2517
   This problem is specific to Paradox tables and can be caused
   in any BDE (16 or 32 Bit) application that meet some or all
   of the following criteria:

     1)  The Executable is in the same directory as the table.
     2)  The Private Directory is not correctly set or not set
         at all.
     3a) Delphi: Having a TTable open on a paradox table and
         then performing multiple TQuery operations.
     3b) C / C++: Having a table open with DbiOpenTable and
         then performing multiple queries with DbiQExec and/or
     4)  LOCAL SHARE set to true in the BDE Configuration
         Utility on the System page.

   To solve the problem, make sure that your application has
   done ALL of the following:

     1)  Under the directory where the executable is, create
         three new directories: TABLES, PRIV, and NET.  Place
         all the tables for the application into the TABLES
     2)  Set the session's private directory to the PRIV
         directory.  Take the following steps according to
         the software you are using.

         Session.PrivateDir := ExtractFilePath(ParamStr(0)) + 'PRIV';

         C / C++:
         // szPath is the fully qualified path (not relative)
         // to the PRIV directory.

     3)  Set the session's network directory to the NET
         directory.  Take the following steps according to
         the software you are using.

         Session.NetFileDir := ExtractFilePath(ParamStr(0)) + 'NET';

         C / C++:
         DbiSetProp(hSes, sesNETFILE, (UINT32)szPath);
         // szPath is the fully qualified path (not relative)
         // to the NET directory.

         // hSes is the current session handle.  This can be
         // retrieved using the DBiGetCurrSession function.

     4)  If LOCAL SHARE is set to true and you are not sharing
         tables between different applications at the same time,
         change LOCAL SHARE to false.

   The above steps will correct the Lock File Too Large error.

Best Regards.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now