Lockfile has grown too large

Posted on 2002-07-19
Last Modified: 2007-12-19
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.

Question by:roosiedb

Expert Comment

ID: 7165746
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.

Accepted Solution

marcoszorrilla earned 50 total points
ID: 7166559
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.

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now