Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File Locking
Message
 
 
À
28/11/2000 13:53:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00446331
Message ID:
00446361
Vues:
5
>I have a file out on a server that people connected to the network use to add transaction records to. They add the records by USEing the file and appending from their local file. Several employees use this file, the append takes a minute or so...works great.
>
>
>Periodically another user USEis it and reads the accumulated records into his local file for processing. Works great.
>
>The number of users on the system now has greatly increased and every once in awhile two of them try to append to the file and one gets an error. What should be done to lock the file...Do I use the flock() function?
>
>
>TIA
>Chris

APPEND FROM locks the table header. You could use FLOCK() but that would prevent others from editing other records (if that takes place). I would recommend using RLOCK(0) to lock the header. If successful, then do the append and unlock it when done. Otherwise, display a message telling them to try again later.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform