Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best coding practices regarding open/unopen tables
Message
From
22/12/2003 09:49:04
 
 
To
21/12/2003 19:30:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00859873
Message ID:
00861255
Views:
30
Hi All,

I would like to point out an other factor with continously opened tables.

When you first time open a table in a LAN enviroment, VFP will cache some parts of the table content in local memory. VFP will refresh this cached contect according to Set Refresh setting. Additional openings (in any DataEnviroment in VFP6) has no effect on the locally cached data, I mean VFP won't refresh this cache, as long as
1. you close all alias on this dbf and reopen it. (I mean there must be a moment when all of opened aliases closed)
2. or issue an flock() command under any alias of this dbf.

Because in our application many different window can be opened, I always use the 2nd approach to get absolutely recent data from the table. But, of course it takes time, to make VFP the refresing: to pull down the data over the wire.

This info is very usefull when you check for teh most recent value of a record in a continously opened table.

(These are my experiences)


bb



>You are right about that. For a while I thought that there is a way to open Views / SQLs without having to open the underlying tables. The only way would still be remote views.
>
>Thanks for the discussion Stefan!
>
>Dennis
>
>>> So we have to explicitly close the underlying tables, right?
>>
>>Yes, that is what I meant to say. If you want the source tables to be closed after the query then you have to do it yourself, and the easiest way of doing so without affecting other modules is to use the tables under temporary aliases because then it is known that no other module could conceivably be using those aliases.
>>
>>Another positive side effect is that you can explicitly specify the manner in which those tables are opened (SHARED, NOUPDATE) whereas the SQL commands will use ambient settings like SET EXCLUSIVE for this.
Previous
Reply
Map
View

Click here to load this message in the networking platform