Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exclusive USE not really exclusive?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00285709
Message ID:
00285774
Vues:
16
>Is there any instance in a multi-user environment where two computers/sessions might both open up a file exclusively for read-access without giving me an error when it can't write after reading? Here's the problem I'm currently facing:
>
>
>I have a POS app which has run for years(originally written in Clipper and released in VFP form roughly 1 year ago). In the past 4 months or so, I've had roughly 3 of these occurences(50-500 orders each day per turnkey system-- about 40 VFP turnkey systems in current use), giving me an approximate .00031% occurence rate(200 orders a day on 40 systems for 120 days(approximately 4 months)). Very rare, but people notice when things go wrong. Here's the scenario:
>
>When saving an order, the programs uses an ORDER_NO dbf file exclusively(on record, one field). It tries 8 times with a delay between retries-- it will give an error if it can't open the file after 8 retries. Once the program has the ORDER_NO file, it reads the current Order Number(6-7 digit depending upon system's history/original setup) then increments the order number in ORDER_NO by 1(uses a simple REPLACE command). Then it closes the file, and continues saving the order. Exclusive use of the ORDER_NO file prevents other users from opening it up at the same time and getting duplicate order numbers. However, as I said before, I've had roughly 3 reports of duplicate order numbers in the past 4 months. Is there any bug, issue, problem, or my favorite-- undocumented feature in VFP I should be aware of that would cause this? Any proposed workarounds/checks? Thanks.

There is no way two people can have a table exclusive. That's what exclusive means. Are you buffering this table in any way? You shouldn't be. Can you post the actual code that does this?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform