Saturday, August 18, 2007

Flushing Windows Cache in VFP 8

I have a customer who is a developer using VFP 8 so we cannot use the new FLUSH FORCE functionality.

Here is the observation. Simple form with a private datasession opens the table and displays the data in the standard grid. The table is one of your typical USER tables and it has a logical flag in it to show if a user is logged in or not. The management like to occasionally check to see who is logged in or not. SET REFRESH is set to 10, 10 so every 10 seconds VFP should be refreshing the local buffers.

I can load up the app on my Windows 2003 server and the form performs as expected. As I start instances of the EXE and login as different users I can see the Flags change to true once the grid is refreshed or I move through the records after the 10 seconds.

If I run the EXE on a Windows XP SP2 machine and run multiple instances of the EXE on the same machine I do not get the data refreshed. I have even seen where I run the same form in the same EXE instance set up its own datasession with the old data.

Now I know the private datasessions are doing a USE AGAIN which does not go out to disk and get a fresh buffer, and uses the current cache to set up the new workarea. I also know if we throw in a simple RLOCK() it will refresh the cache.

It would be nice if all the installs were on a real server, but some of the end users are in a peer-to-peer environment and this is causing problems with the refreshing of the data.

My question is: is there something in Windows where we can turn off the data caching? I have hunted everywhere and I cannot find anything. I am recalling reading some where that Window 2003 has this shut off by default, but XP does not, but I cannot find the source of the material I read. Obviously Windows is caching the data or the Fox Team would not have added the FORCE clause for the FLUSH command.

The app cannot be migrated to VFP 9 to take advantage of the FLUSH FORCE. My recommendation to date is to use the RLOCK() "workaround", but understandably if the developer has a toggle of a setting in Windows he would save himself the time of updating 50 forms, performing a complete system test, and the time it takes to redeploy to all his customer locations.

I would appreciate any insight any of you might have.

UPDATE 08-Aug-2007 @10:28 PM: passed along from fellow VFP MVP Fred Taylor on where to set the Windows Write Caching...

"If you mean the disk write caching, in XP bring up a My Computer and right-click on the disk you want, then choose properties. Then under the Hardwaretab, select the actual disk device and then use the Properties button. Under the Policies tab, there should be a check box for write disk caching there."

I appreciate the help Fred!

Labels:

0 Comments:

Post a Comment

<< Home