?
Solved

Lock Timeout

Posted on 2001-08-29
3
Medium Priority
?
1,225 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
[X]
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
  • 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 600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

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