Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to count locked records?
Message
 
À
21/11/1997 07:57:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00061540
Message ID:
00061630
Vues:
39
>>>>I know we can lock, unlock, set multiple locks, and so on, now, can we actually count how many records are locked in a networked table? If I were to issue a command such as COUNT TO N FOR RLOCK() = .F. woudn't I be locking records as I'm counting?, it would make sense to me...then what would be the proper way to do this?
>>>>
>>>>Thanks, ladies and gentlemen...
>>>
>>>Gilberto, could you use Sys(2011)? It will give you the information you want, but I can't think how to use it except by checking every record....
>>>
>>>Barbara
>>
>>Barbara, after all I tried your suggestion and it worked! I tried this with 150,000 records and it took 15 seconds to bring back the result!
>>
>>SET multilocks on
>>GOTO 1200
>>=rlock()
>>GOTO 10000
>>=rlock()
>>GOTO 50000
>>=rlock()
>>GOTO 100000
>>=rlock()
>>GOTO 130000
>>=rlock()
>>
>>count to n for sys(2011) = 'Record Locked'
>>
>>?n
>>
>>Thanks!

For Gilberto's scenario wouldn't it be better to maintain a log table of users and login/logout times that could be queried since locked records are not necessarily an indication of the traffic using the application?

Bill

But this will count only the records locked by the station that sets the locks. The records locked by other stations/users are not seen. Is this good for your traffic statistics?

Vlad

Both of your guy's are very good points. But Bill, in the type of application I'm writing, we need to control customer support among other things, and by having this count being read every set time we know what customers call the most for orders and support, and from there we know the products they purchase and other information, so when doing a marketing study, we have a better idea of who we want to send marketing information, and yes, like it was said before, it just takes ideas on how you can apply this technique. Now Vlad, I haven't tested what you are bringing up, but I'm sure both of us would find ways on how to achieve this, just like say, like Bill suggested, on the records that are locked we could have flags identifying the user that is logged and from there do more and more...

Gil
For every bug fixed, there is a bigger bug not yet discovered.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform