Solved

Lock Timeout

Posted on 2001-08-29
3
1,179 Views
Last Modified: 2010-08-05
Our in-house software consists of Delphi 2 applications running on a Novell network using Paradox tables with v5.1 BDE. The applications are rather data-intensive with multiple client directories and over 80 tables per directory (some 100mb+). Only one client directory is accessed at a time within an application but mutliple applications run on the same computer can access that directory. Multiple users can also access the same directory. Currently up to 25 users can be using the system. This is not client/server software.

All of the sudden we are having problems with Lock Timeouts. These can occur when a table is being opened or during processing. There are no table locks involved.

Other factors that may or may not be involved:
  Multiple instances of tables can be open
  TDatabase component used to switch to different client directories (open/close to switch)
  Remote users are logging through a Citrix server
  Recently (but after timeout problems) upgraded BDE from v4.x

Some things we have tried include:
  Upgrading the BDE
  Setting the Session PrivateDir to the users' local harddrive for sql lock files
  Setting the Session LockRetry to a greater number

Lock files seem to be a mystery with the program having little control over them. The easy answer is to upgrade Delphi and use a different database but other factors at this moment prevent that. What can cause lock timeouts; can you programatically trap or prevent them?
0
Comment
Question by:lal_delphi
  • 2
3 Comments
 
LVL 4

Expert Comment

by:YodaMage
ID: 6438176
You have two applications accessing the same table. Delphi puts a write lock on tables while checking to see if table is opened for exclusive use. App1 Locks table rather you like it or not while checking for .lck's, then app2 accesses the table and also applies a tempory lock while it analizes and opens the table.

When app1 tries to release its' lock, BOOM, it cannot because of the lock applied by the second application.

You can try adding:

Check(DbiSetLockRetry(5))

to your code.
0
 

Author Comment

by:lal_delphi
ID: 6438270
Your explanation of what's happening with the lock files makes some sense. But, to clarify, are you saying that multiple sessions/users can put locks on the same table but one can't release their lock if another session/user has placed a lock? That doesn't seem right.

We've already tried Check(DbiSetLockRetry(5)), even with a larger value since 5 is the default value.
0
 
LVL 4

Accepted Solution

by:
YodaMage earned 150 total points
ID: 6438650
That is the case.

App1 places lock. App2 Places Lock. App1 tries to remove lock but cannot because another app/process, in this case App2 has a lock.....ERROR

Paradox was never intended for the concurrent use to the degree you have.

You can also change some of the BDE setting to increase timeout period, but if you are on a 10mps network you have really hit the wall. You almost have to look to restructure some table so that you can in fact use exclusive use locks, or look to use exclusive use locks in conjuction with temp tables on the clients.

I've been there....and now I only use InterBase.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtuailstring tree add node to another virtuailstring tree list 4 115
Printing problem 2 94
HTML text in the body of an email (delphi code) 12 118
Dev Express grid collapse 2 45
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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