Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!uupsi!tate!cy From: cy@dbase.a-t.com (Cy Shuster) Newsgroups: comp.databases Subject: Re: Foxpro problem (yes, really) Keywords: Multiuser Message-ID: <1991Jun20.225444.1139@dbase.a-t.com> Date: 20 Jun 91 22:54:44 GMT References: <10261@star.cs.vu.nl> Sender: news@tate.a-t.com Organization: Ashton-Tate, Inc. Lines: 39 Originator: cy@dbase Nntp-Posting-Host: dbase In article <10261@star.cs.vu.nl> jdvries@cs.vu.nl (Vries de Jeroen) writes: >I need some help with what seems a bug in Foxpro/LAN. >When I want to add records to a file on more workstations >simultaneously I run into the following problem. If one >of the workstations allready has one ore more records >locked (which is allways so in my case) it does not detect >the fact that another workstation might have appended a >record before it does. Result is that both workstations >think they have a new record whereas there is only one >new record created. When neither of the workstations have >any locks on the database, the problem soe not occur. >I think I tried allmost every permutation of the different >MULTILOCKS,DELETED etc... settings but the bug persists >resulting in a multi-user system that can only append new >data from one workstation at a time. > >Is this a known problem and better yet, is there a cure >(other than abbandoning FoxPro?) I don't know for sure about FoxPro, but dBASE IV has an internal APPEND lock, explicitly to prevent two people from APPENDing at the same time (disk full problems, etc.). The answer is to pre-allocate records which can be replaced by anyone, along with a record which holds the next available value. If you know what the new keys will be, this will also speed up performance, as otherwise an APPEND BLANK followed by a REPLACE causes two updates to the relevant indices, while if you preallocate new records with the key in place (perhaps as deleted records?), you take no hits on the index, only the data portion. Anyone have any better techniques? (There are several ways to serialize new integers across a network that are more efficient than causing everyone to bottleneck on a data record with the next available number. Use the Baskin-Robbins model, for example.) --Cy-- cy@dbase.a-t.com