Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 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