Board index » delphi » Record Locks/Delphi 2.0/Win '95

Record Locks/Delphi 2.0/Win '95

Hello..

        I have written a relational database program with Delphi 2.0. The program
uses a customer data file and a customer sales file. I have the system set
up at two office -- the first office is running a Windows NT 4.0 server and
seven Windows '95 stations. At this office, everything works fine. For
example, when User A is editing customer record SMITH and User B tries to
call up customer SMITH, User B gets a programmed "Record is Locked!"
message.

        At office #2, with just two Windows '95 stations, one of which is acting
as the "server", the "Record is Locked!" message does not appear under the
same scenerio as above.

        Additionally, if either user edits a sales record the changes do not show
up immediately on the other station. If this sales record is called up by
the second user after it has been edited by the first, but it has not been
updated on the second machine, all sorts of garbage ends up in the data
file -- at one point causing it to jump from 3mb to 639mb!!

        I have turned off the "read ahead cache" on both Windows '95 machines, but
that has not solved the problem. I have also disabled the "new" file
locking schematics, but that has not worked either. (should I turn those
back on?)..

        Any ideas would be greatly greatly appreciated!

Rich Morey
rwmo...@hamptons.com
ad...@shpress.com

 

Re:Record Locks/Delphi 2.0/Win '95


Wow, what a long list of newsgroups - maybe you should be more selective.
Reply only in CLPD.databases.

Your post lacks detail: exactly which relational database are you using?
This is a key piece of information.  Win95 peer-to-peer networking using
the BDE and Paradox tables works fine if set up properly.  Locking works as
expected.  

Presuming you're using the BDE with Paradox and have it configured properly
then to synchronise data you need to

        (1) save it (use Post)
        (2) flush the cache (use dbiSaveChanges(); or DbiUseIdleTime;)
        (3a) use Table.refresh (or Table.close; Table.open)
        (3b) use Query.close; Query.open; (Query.refresh won't do)

There was a post (see below) which claimed Borland had stated that
DbiSaveChanges and DbiUseIdleTime did not work (with Local Share true).  I
have not been successful with DbiCheckRefresh or DbiForceRecordReread.
Refresh seems to work.

There was also a post about NT Server (see below).

Post 1: (12/1/97)

 "      Forum: Borland Dev. Tools Subj: Flushing the cache?

        Section: Borland DB Engine

        To : Scott Frolich [Borland], 74431,257  12/17/96 16:53 PM
        From: Richard Haven (SCS), 73427,710 #98826

        >> DbiUseldleTime is not working with BDE 3.12 and BDE 3.5. <<

        Is this a deficiency in these versions or is DBiUserldleTime
deprecated?

        -- Richard Haven
        Santa Cruz Software, 73427.710
        1 7-Dec-1 996
        rha...@santacruz.com

        ******************  Reply  
*****************************************

        Forum: Borland Dev. Tools Subj: Flushing the cache?

        Section: Borland DB Engine

        To : Richard Haven (SCS), 73427,710 12/18/96 8:40 PM
        From: Scott Frolich [Borland), 74431,257 #98870

        Hi Richard,

        It is a deficiency that I hope to have fixed in the next version
of BDE.
        Please use DbiSaveChanges for now.

        BTW: Both these functions only have effect if the tables are
local
        AND LOCAL SHARE is FALSE.

        Scott

Regards,
Dave Robinson, VP Development
Amber Computer Systems Inc."

I wish Borland would respond here about this.

The same author (Dave Robinson) wrote the following:

Post2: (4/Feb/97)

"In regards to an NT Server you may find the following VERY helpful. Look
up Microsoft Article Q102967 on the NT Knowledge base."

I think this has been fixed (in 3.51 & 4.0).

HTH,

--
Paul Motyer
pa...@pccity.com.au - now working!
Soft Stuff, Croydon, Australia, 3136

Richard Morey <rwmo...@hamptons.com> wrote in article
<01bc37c9$29c2d5c0$b1708dcc@rwmorey>...

Quote
> Hello..

>    I have written a relational database program with Delphi 2.0. The
program
> uses a customer data file and a customer sales file. I have the system
set
> up at two office -- the first office is running a Windows NT 4.0 server
and
> seven Windows '95 stations. At this office, everything works fine. For
> example, when User A is editing customer record SMITH and User B tries to
> call up customer SMITH, User B gets a programmed "Record is Locked!"
> message.

>    At office #2, with just two Windows '95 stations, one of which is acting
> as the "server", the "Record is Locked!" message does not appear under
the
> same scenerio as above.

>    Additionally, if either user edits a sales record the changes do not
show
> up immediately on the other station. If this sales record is called up by
> the second user after it has been edited by the first, but it has not
been
> updated on the second machine, all sorts of garbage ends up in the data
> file -- at one point causing it to jump from 3mb to 639mb!!

>    I have turned off the "read ahead cache" on both Windows '95 machines,
but
> that has not solved the problem. I have also disabled the "new" file
> locking schematics, but that has not worked either. (should I turn those
> back on?)..

>    Any ideas would be greatly greatly appreciated!

> Rich Morey
> rwmo...@hamptons.com
> ad...@shpress.com

Re:Record Locks/Delphi 2.0/Win '95


Try looking at your BDE settings, what database are you using?

Martin

Richard Morey <rwmo...@hamptons.com> wrote in article
<01bc37c9$29c2d5c0$b1708dcc@rwmorey>...

Quote
> Hello..

Re:Record Locks/Delphi 2.0/Win '95


Quote
Richard Morey wrote:

> Hello..

>         I have written a relational database program with Delphi 2.0. The program
> uses a customer data file and a customer sales file. I have the system set
> up at two office -- the first office is running a Windows NT 4.0 server and
> seven Windows '95 stations. At this office, everything works fine. For
> example, when User A is editing customer record SMITH and User B tries to
> call up customer SMITH, User B gets a programmed "Record is Locked!"
> message.

>         At office #2, with just two Windows '95 stations, one of which is acting
> as the "server", the "Record is Locked!" message does not appear under the
> same scenerio as above.

>         Additionally, if either user edits a sales record the changes do not show
> up immediately on the other station. If this sales record is called up by
> the second user after it has been edited by the first, but it has not been
> updated on the second machine, all sorts of garbage ends up in the data
> file -- at one point causing it to jump from 3mb to 639mb!!

>         I have turned off the "read ahead cache" on both Windows '95 machines, but
> that has not solved the problem. I have also disabled the "new" file
> locking schematics, but that has not worked either. (should I turn those
> back on?)..

>         Any ideas would be greatly greatly appreciated!

> Rich Morey
> rwmo...@hamptons.com
> ad...@shpress.com

Does the second system work reliably on all other network functions?
Try swapping the role of "server" between the machines on your second
network. You might try swapping machines between the two offices to
help narrow down the problem to hardware or software. Try also running
your program on just 2 WIN95 machines, split off from the rest, at your
first office. How about reinstalling your program; maybe it is corrupt.
For that matter, maybe WIN95 is corrupt on one of the machines.

Re:Record Locks/Delphi 2.0/Win '95


The BDE is not multi-user for the peer2peer Windows 95 network. It is easy
to verify that (whatever you do the refresh and all the locks are dead). It
is definitely not your fault, my friend. As far as I know you have to
install a second NT server (it is cheaper than changing the rest of the
system (the BDE DLL-s:-)).

Yours,
DM

Re:Record Locks/Delphi 2.0/Win '95


Quote
Richard Morey wrote:

> Hello..

>         I have written a relational database program with Delphi 2.0. The program
> uses a customer data file and a customer sales file. I have the system set
> up at two office -- the first office is running a Windows NT 4.0 server and
> seven Windows '95 stations. At this office, everything works fine. For
> example, when User A is editing customer record SMITH and User B tries to
> call up customer SMITH, User B gets a programmed "Record is Locked!"
> message.

>         At office #2, with just two Windows '95 stations, one of which is acting
> as the "server", the "Record is Locked!" message does not appear under the
> same scenerio as above.

>         Additionally, if either user edits a sales record the changes do not show
> up immediately on the other station. If this sales record is called up by
> the second user after it has been edited by the first, but it has not been
> updated on the second machine, all sorts of garbage ends up in the data
> file -- at one point causing it to jump from 3mb to 639mb!!

>         I have turned off the "read ahead cache" on both Windows '95 machines, but
> that has not solved the problem. I have also disabled the "new" file
> locking schematics, but that has not worked either. (should I turn those
> back on?)..

>         Any ideas would be greatly greatly appreciated!

> Rich Morey
> rwmo...@hamptons.com
> ad...@shpress.com

I believe it's a BDE configuration error.  Go through and re-read the
section on peer-to-peer setup.  We have 5 workstations connected to a
non-dedictated win95 server.  Had massive problems with locking until we
changed a BDE setting.

Paul

Re:Record Locks/Delphi 2.0/Win '95


If you open the BDE up and highlight the Paradox driver, you will see the
NET DIR section.
All clients must be mapped to the same network drive letter!
If you are running peer to peer you will have to make sure that one of the
clients has a drive letter greater than 'C'.  
This can be accomplished by placing in the Autoexec.bat file the following
command:
c:\windows\system\subst Z: C:\
Do this on only one computer!!!

1.  Now open the BDE and under NET DIR, type in Z:\  

2.  Go to the next computer and map the drive letter Z to the first
computer.
        You can do this by running 'Winfile' and the run command.

3.  Open the BDE on this computer and repeat step 1.

Also, scan each computer and delete all *.lck files and any paradox.net
files.

Rod

Paul Hamilton <pa...@iap.net.au> wrote in article
<333B039A....@iap.net.au>...

Quote
> Richard Morey wrote:

> > Hello..

> >         I have written a relational database program with Delphi 2.0.
The program
> > uses a customer data file and a customer sales file. I have the system
set
> > up at two office -- the first office is running a Windows NT 4.0 server
and
> > seven Windows '95 stations. At this office, everything works fine. For
> > example, when User A is editing customer record SMITH and User B tries
to
> > call up customer SMITH, User B gets a programmed "Record is Locked!"
> > message.

> >         At office #2, with just two Windows '95 stations, one of which
is acting
> > as the "server", the "Record is Locked!" message does not appear under
the
> > same scenerio as above.

> >         Additionally, if either user edits a sales record the changes
do not show
> > up immediately on the other station. If this sales record is called up
by
> > the second user after it has been edited by the first, but it has not
been
> > updated on the second machine, all sorts of garbage ends up in the data
> > file -- at one point causing it to jump from 3mb to 639mb!!

> >         I have turned off the "read ahead cache" on both Windows '95
machines, but
> > that has not solved the problem. I have also disabled the "new" file
> > locking schematics, but that has not worked either. (should I turn
those
> > back on?)..

> >         Any ideas would be greatly greatly appreciated!

> > Rich Morey
> > rwmo...@hamptons.com
> > ad...@shpress.com

> I believe it's a BDE configuration error.  Go through and re-read the
> section on peer-to-peer setup.  We have 5 workstations connected to a
> non-dedictated win95 server.  Had massive problems with locking until we
> changed a BDE setting.

> Paul

Re:Record Locks/Delphi 2.0/Win '95


In the bde configuration program make sure that the flag LOCAL SHARE is set
to TRUE for all workstations.

Ed

Re:Record Locks/Delphi 2.0/Win '95


Good answer (except the fact the Subst.EXE is waiting for you in
\Windows\Command). Windows and Windows\Command are always in the path (even
you don't have an autoexec.bat).

I see the BDE is very flexible :-)

Yours,
Dan Marinescu

Other Threads