Lockfile has grown too large

Posted on 2002-07-19
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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 150 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

762 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