[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Lock Timeout

Posted on 2001-08-29
3
Medium Priority
?
1,254 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 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

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

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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 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