Solved

Lock Timeout

Posted on 2001-08-29
3
1,165 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now