Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Questions about record locking
Message
De
17/02/2002 15:23:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00621109
Message ID:
00621326
Vues:
9
>>>>I was thinking to use some scheme to limit the number of users connected simultaneously (example: limit to 5 users). Locking 5 consecutive records in a table seems safer than saving information to a table. For, if the user's computer hangs, he will remain "logged in", if I use a REPLACE scheme.
>>>>
>>>>Hilmar.
>>>
>>>Take a look at the article 'Limiting Simultaneous Users' by Craig Berntson http://www.craigberntson.com/Articles/kb003.htm
>>
>>Thanks for the link. However, I wanted to ask what you think about the following: wouldn't it be simpler to place locks on 5 (or 10 - depending on the number of licenses) consecutive records in a table, instead of creating files with LLFF and seeing whether they can be opened? Or would record locking be less safe, for some reason?
>>
>
>Hi Hilmar,
>
>Yes it is simplier and will work as long as your application relases locks. The problem starts when application is terminated w/o releasing the lock, for example it crashes or PC is turned off for any reason. In those cases OS could keep the lock from minutes to hours depending on OS and other factors. I don't think your users would be happy with this scenario.

OK then, the next question: Craig Berntsons method seems to rely on fopen(). Now let's say I trip the power cord on my computer. Will another user be able to fopen() the file I failed to close, relatively soon?

TIA, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform