Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock file has grown too large error

Status
Not open for further replies.

mthakershi

Programmer
Aug 24, 2001
79
US
Hi folks,

I am using Paradox database with Borland C++. This is the first time I am using both of them. So I am little bit scared when I face errors.

Executable and database are in different directories. When I am running the EXE it generates Paradox lock file in same directory. Once it increases size around 25 MB it gives error "Lock file has grown too large" and after that "Capacity not supported".

I found solution to create 'Tables', 'PRIV' and 'NET' directories in folder having EXE and set sessions properties. For that I need to call following functions.

DbiSetPrivateDir(szPath);
DbiSetProp(hSes, sesNETFILE, (UINT32)szPath);

Can somebody tell me from where in code I can call this functions? My project in BC++ Version 5.0 and I am using data modules and Woll2Woll controls for connecting to BDE and access to database.

If someone has some other idea to fix this problem without moving my database files then please help me out.

Any help is appreciated,
Malay Thakershi
mthakershi@yahoo.co.in
 
The following is from Borland's Community site:

Technical Information Database

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

Description:
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
DbiQExecDirect.
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
directory.
2) Set the session's private directory to the PRIV
directory. Take the following steps according to
the software you are using.

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

C / C++:
DbiSetPrivateDir(szPath);
// 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.

DELPHI:
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.


See: James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Hey,

I know this topic. I wanted to know where in C++ code can I call those functions and how. I am using data modules and Woll2Woll query controls to access database.

Anyways, thanks for the reply. I will try this out.

Malay Thakershi
mthakershi@yahoo.co.in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top