Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who has the record locked?
Message
From
09/12/1997 17:40:04
 
 
To
09/12/1997 17:24:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00064802
Message ID:
00064816
Views:
40
Erik,

Your safest route is to cross ISRLOCKED and ISFLOCKED *OFF* the list of valid VFP commands - they do *NOT* do what the Help says they will do, and they *NEVER* have. Been this way since they were introduced, yet never was the Help "improved" nor the commands dropped, by MS!

Apparently what they report is the status relative to the command ISSUER. At least that's what someone has boiled it down to.

Cheers

Jim N

>>>>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform