Wednesday, February 16, 2005

VFP 9 & opportunistic locking

A reader sent in the following:

“We recently discovered that our VFP8 app was encountering corrupt databases (error 2091) regularly and have determined the cause to be opportunistic locking on the server and workstations. We have been unable to find any reference to opportunistic locks or their impact on VFP RDBMS in any of the VFP documentation from vfp5 through 8.”

The resolution is related to how the OS is disk caching.

Windows XP SP2 / Win2k*:

Cut and paste the following into a file called woplocks.reg and run it on the workstations:



REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkStation\Parameters]
"EnableOplockForceClose"=dword:00000001
"EnableOplocks"=dword:00000000
"UseOpportunisticLocking"=dword:00000000


Cut and paste the following into a file called soplocks.reg and run it on the server

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"EnableOplockForceClose"=dword:00000001
"EnableOplocks"=dword:00000000


Novel settings are:

Opportunistic Locking set off
Cache Rights set off
Delay Rights set off
Packet Burst set off
True Commits set ON

No comments: