Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who has the record locked?
Message
 
À
09/12/1997 17:24:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00064802
Message ID:
00064955
Vues:
30
>>>>I posted this question a week or two ago and got no answer (well... none that I liked anyway :-))
>>>>
>>>>Is there a way I can tell which record(s) in a table are locked without scanning the table and checking for locks on each individual record?
>>>>Even better, is there some way to tell who (or what process) has it locked?
>>>
>>>I think if you want to check locks, you should really scan and check. You can built some mechanism to check who is 'lock holder', e.g. additional field which will be filled programmatically with oApp.userid anytime someone RLOCK() from application. Also, you can have some table (I call it 'locker.dbf') which check user name of 'form/process holders', if you want to provide one-user access to particular functionality.
>>
>>Thanks for the pointer, but my need is more of the troubleshooting type than the app design type. I considered an additional field in my main tables to hold who has the record locked, but at the time of app design, didn't deem it necessary. Scanning the table to check for locks just takes too long (125,000 records)... about 10-12 minutes. What would be cool is some sort of super secret internal index that keeps track of record locks... that's what I was hoping for.
>>I guess the way that Fox knows if someone has a record locked is some sort of switch in the table header that doesn't hold the record, just whether or not there is a record locked.
>
>Ok another related question...
>I thought that isrlocked() was supposed to return the lock status of a record... whether anybody has it locked.
>I just did some testing.
>
>USEd the same table in VFP on both computers on my desk.
>GO record# whatever (on both computers)
>computer #1: RLOCK()
>computer #1: ?ISRLOCKED() &&returns .T.
>computer #2: ?ISRLOCKED() &&returns .F.
>computer #2: ?RLOCK() &&returns .F.
>
>What gives? Am I misunderstanding the purpose of ISRLOCKED()? Is the only real way to see if a record is locked to try and lock it?

No misunderstanding on your part. I ran into the same problem and now avoid the function altogether. Use IF RLOCK() instead. Related to your original question, you stated your need was more for administrative purposes instead of app purposes. What kind of admin are you talking about?
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform