Board index » delphi » Tables in exclusive mode

Tables in exclusive mode

Hi all,

In my app the tables are opened in exclusive mode to prevent two users work
on them simultanely. When one user starts the app it checks whether the
tables are already opened. But there's one problem. If the app ends
uncontrolled (i.e. if the user presses ctrl+alt+del) the tables remain open,
and other users can't start the app. How can this be solved?

Thanks in advance,

Tove

 

Re:Tables in exclusive mode


In article <8lm8kk$c...@bornews.borland.com>, tove.bjornb...@c2i.net

Quote
(Tove) wrote:
> In my app the tables are opened in exclusive mode to prevent two users
> work on them simultanely. When one user starts the app it checks whether
> the tables are already opened. But there's one problem. If the app ends
> uncontrolled (i.e. if the user presses ctrl+alt+del) the tables remain
> open, and other users can't start the app. How can this be solved?

Get the app to delete any .lck files (paradox.lck and pdoxusrs.lck?) as it
starts up, before it tries to open any tables.  If another user is
actually running the app, the delete will fail as the .lck files will be
open, so there will be no harm done in trying to delete active files.

If the user's machine has just 'disappeared from the network unannounced',
however, the .lck files may still be open on the server.  You may have to
bring the rogue machine back on to the network for the server to realise
that it no longer needs the files to be held open.

--Bill Sparrow--

Other Threads