Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to refreshing local buffers immediately?
Message
De
07/02/2001 14:08:38
 
 
À
06/02/2001 02:51:36
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00470592
Message ID:
00473530
Vues:
47
Walter,

I found that successful rlock() or flock() and after that
immediately unlock refreshes WHOLE table always.
No need even to hold lock during SQL SELECT

I issue

SET REFRESH TO 0,1

in my app init and will never restore it.

I don't have observed that
this causes vfp perfomance degradation as VFP help says.
There seems to be no difference between vfp default
SET REFRESH TO 0,5 and my custom SET REFRESH TO 0,1



>Hi Andrus,
>
>>>1. Using RLOCK (only current record)
>>I use SQL select to select data. There is no such thing as
>>"current record".
>
>To my knowledge this only refreshes the current record and not the whole buffer. I could be wrong here. Your SQL statement would not be run over a total refreshed buffer.
>
>>What do you thing about using this generic refreshing routine
>>as Larry suggested:
>>
>>DO WHILE !RLOCK(STR(INT(RAND()*RECCCOUNT('MyTable'))), 'MyTable')
>> ENDDO
>>UNLOCK IN MyTable
>
>If the RLOCK() function does refresh the whole buffer, it would be a nice enhancement, however I thought it only refreshed one record (Again I could be wrong here)
>
>>However, if I have ten tables need to be refreshed, must I
>>run this for all ten tables ?
>
>Yes !
>
>>It it difficult to find which tables need to be refreshed if there
>>are many SELECTs returning data.
>>I need to refresh ALL tables at once.
>
>>>2. Using FLOCK
>>Some other users, open forms, some other aliased are used based on
>>MyTable. So FLOCK() does'nt refresh, isn't it ?
>
>Again, I think it should refresh the whole buffer and if noone else has placed a lock() it should work fine. Remember to release it right after the FLOCK function to avoid failing locks by other users.
>
>>>3. Closing the table and loading it again (but the table must be closed entirely, so other open aliases also).
>
>>I want to use multiple windows: I cannot close all forms in my screen: data entry may be in progress in some windows using MyTable !
>
>That's correct.
>
>>>4. Using SET REFRESH
>>>It seems that in your case using SET REFRESH might be the only option you've got. It seems that you can have a 0.1 for the second parameter, but don't now if this works properly, maybe you can try. However one more suggestion thoug:
>>
>>This does not work:
>
>>SET REFRESH TO 0, 0.1
>>DISPLAY STATUS
>
>>result: it shows that SET REFRESH is 0,0
>>SET REFRESH seems to accept integers only as parameters.
>
>>It it possible to refresh using SET REFRESH without 1 sec delay
>>caused by INKEY(1) ?
>
>>>Just issue a SET REFRESH TO 0,1 (and INKEY(1.5) just before you execute the query and restore its value after it has been completed. Setting SET REFRESH is not scoped to the current datasession so restoring the old value gives less network trafic and could be a performance advantage in other forms.
>>
>>Do you really think that SET REFRESH TO 0,1 decreases
>>performance?
>
>No, just as long as you restore the original contents when the buffers are freshed. The problem is that SET REFRESH TO 0,1 refreshes its buffers each second and therefore causes a lot of networktrafic. Therefore it might be better to only use this strategy when you need to refresh your buffers.
>
>Walter,
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform