Board index » delphi » Will Lock Violations Go Away!!

Will Lock Violations Go Away!!

Hi,

I have had endless trouble with LOCK VIOLATIONS within my applications.
We are still using Delphi 1 (I know!) and are moving straight to delphi
5 very soon. The story so far:

We have peer to peer networks running Windows 98  with a server PC
storing all tables. All the other PC's have the NET DIR pointing to the
server. All applications work fine most of the time. I have placed a lot
of Exception handling to get around the lock violation problem. Only the
Server UPDATES the tables. All other applications just read the tables.
The Lock violations seem to appear when one user has the table open
(without exclusive use and even having the READ ONLY property set to
True) whilst the Server pc tries to update.

I have looked EVERYWHERE and have found a lot of information of
networking with delphi, but not a lot on LOCK VIOLATIONS. This
apparently is a dos error which I have set the "Disable new file sharing
and locking semantics" on within the Windows File System Setup.

My two main questions are:

Is there anything that can stop these Lock Violations?

and if not, will moving to Delphi 5 make the problem go away?

Please Help!

Thanks.

 

Re:Will Lock Violations Go Away!!


What is the exact and complete text of the error message you are getting?

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:Will Lock Violations Go Away!!


The errors are trapped using exception handling. I use On EDBEngine Error.
This logs the error as Lock Violation on Table ????. I ran the program using
the Delphi IDE so I could see what error would show up when it happened. This
is what came up:

    Project ?????? raised exception class EDBEngineError with message 'Lock
Violation. Table c:\?????????'

The error occurred when the table was being opened. "Table1.Open".

The Exception does not give me an error number, but when investigating this
earlier, I found a list of DOS errors in which was the Lock Violation Error.

I will try to explain the system that we have running in as little detail as
possible:

The SERVER PC has a program running on it all the time that looks in certain
directories every 2.5 seconds for any tables to be updated. These tables are
copied from one of the workstation pc's. The tables are copied using
DbiCopyTable.
The Server program is the only program that updates tables. All other
programs running on other pc's only read the tables.
It seems that the workstation pc's are somehow placing a lock on certain
tables from which the Server program tries to open, but can't.

The senario from the above error occurred when one of the Workstations copied
a table to the Server PC. The Server program then located this file by using
FindFirst. The table is then checked if the Size is greater than zero in case
it is still being copied. If it is, the program tries to open the table from
which the program stopped with the Lock Violation.

All tables are held on the Server PC in 'C:\SERVER\DATA'. The Workstations
Net Dir points to 'G:\' which is mapped as the C:\ drive on the Server.

Hope this explains what is happening. If you have any ideas, please Help. If
you need more info, please let me know.

Thanks

Jamie

Quote
"Bill Todd (TeamB)" wrote:
> What is the exact and complete text of the error message you are getting?

> --
> Bill

> Bill Todd (TeamB)
> (TeamB cannot respond to questions received via email)

Re:Will Lock Violations Go Away!!


Step one is to make sure that the BDE on _every_ machine is configured as
described in TI247B at www.borland.com/devsupport/bde/ti.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:Will Lock Violations Go Away!!


The BDE is configured the same on every machine as described in the TI. The
only thing I am not sure about is the NETWORK directory. I have a directory
for the applications and a directory for the tables. The NET DIR is set the
the Server's C:\ drive. Should this be set to a different directory other the
the root directory?
Quote
"Bill Todd (TeamB)" wrote:
> Step one is to make sure that the BDE on _every_ machine is configured as
> described in TI247B at www.borland.com/devsupport/bde/ti.

> --
> Bill

> Bill Todd (TeamB)
> (TeamB cannot respond to questions received via email)

Re:Will Lock Violations Go Away!!


Yes. It is not a good idea to use the root dir for the NetDir. Use a
subdirectory.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads