Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set refresh to ... second parameter
Message
From
25/03/1999 05:22:41
 
 
To
24/03/1999 21:40:20
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00201654
Message ID:
00201773
Views:
10
>Hi Bela,
>
>I honestly do not know what is making it work. All I can tell you is that we had thought we were stuck when this was tried for lack of anything else left to try and, to our surprise, it worked.
>
>Cheers,
>
>Jim N
>
>>Hi Jim!
>>
>>I mean, If I put a record lock manually, VFP will read the record from network, instead of its internal cache.
>>I tested your idea. Yes, It works. I need the absolutely latest contest of a table, as You. Till now, I did a Flock()+unlock. I heard, that it forces VFP to reread the contest of an opened table (into its internal cache), so subsequent read acces to any record of this table will give the latest data. Without manual file locking, record data can be a non up-to-date cached data.
>>From your trick, I guess VFP reread the contest of a record or whole table (?), when record pointer moves. Is it or not?
>>
>>BB
>>
>>>Bela,
>>>
>>>I had good luck in a very particular circumstance... (in FPD 2.6) I had a 1-record table which I always needed the absolutely latest content of and found that a "GO 1" did the trick for me.
>>>
>>>However, I don't really understand what you want/need, since you say 'read" and 'without locking'. I never knew of a read access which did a lock. Also, you can legally lock the same record many times in an app (if that's really what you want to do <bg>).
>>>
>>>Can you give more details?
>>>
>>>Jim N
>>>
>>> >Hi All!
>>>>
>>>>Can anybody tell me, how to force VFP to reread an opened table from the network without locking it? I thought that SET REFRESH affects it, but it didnot...
>>>>
>>>>BB

Hi Jim!

I made detailed tests on your suggestion.

I used the following test program on 1 machine:

do while inkey()=0
go 1
? Myfield
enddo

From an other machine I issued

replace myfield with "some other data"

And I checked, when the first machine shows the changing. So, the changing showed at certain delaying. The delaying was correlated by the Set Refresh second parameter. (Of course, the average delay time was the half of the Set Refresh second parameter.) If you issue: Set refresh 0, 0 It makes the first machine to NEVER show in this loop the updated field data. If you issue Set Refresh 0,1 It guarantees, that the loop will show the updated field value within 1 sec.
My old method - locking the file - guarantees, that you can see updated value at once. But I wanted to avoid these locks.

Thanks again the base idea!!!!

BB
Previous
Reply
Map
View

Click here to load this message in the networking platform