• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1296
  • Last Modified:

Lock Timeout

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
lal_delphi
Asked:
lal_delphi
  • 2
1 Solution
 
YodaMageCommented:
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
 
lal_delphiAuthor Commented:
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
 
YodaMageCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now