Disable opportunistic locking (ALL operating systems)
Previous  Top  Next



Background

Opportunistic locking which is also called "oplocks" is an operating system feature which attempts to improve performance by caching files. It is important (not only for Advanced Accounting but many other database software systems) to disable opportunistic locking when running with the database engine that comes with the standard product (which is workgroup engine)

IMPORTANT EXCEPTION: If you are running a client-server version of Pervasive.SQL with Advanced Accounting, then this section does not apply to you and there is no known conflict with oplocks (and in fact, it will improve performance). For further information about using Pervasive.SQL and Advanced Accounting please see further information on our web site under Software.

Operating systems impacted

Most operating systems (even Linux) have an opportunistic locking feature. Novell however disables opportunistic locking as its default and therefore this is usually not an issue with Novell. If you are using a Novell server, simply make sure that oplocks have not been enabled. In contrast, Microsoft systems enable opportunistic locking by default. Opportunistic locking must be disabled on all PC's and at BOTH the workstation and server/host levels.


Microsoft specific information

The remaining information is provided as a convenience and as a reference but as with other information provided in this guide, we do not warrant in any way that this information is accurate, current and/or appropriate for your network system and you should normally refer this to your network consultant or information technology person for proper implementation.


WIN 95 (peer network)

In WIN95 you must first make sure that the updated VREDIR has been installed. Then you should also make the following registry change:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VREDIR
Value=DiscardCacheOnOpen
Binary Value Data=01

We also recommend disabling the new file sharing and locking semantics and disable write-behind caching for all drives. Go to Control Panel --> System --> Performance --> File System --> Troubleshooting and click on the following two items:

   Disable new file sharing and locking semantics
   Disable write-behind caching for all drives


WIN 98 (peer network)

Make the same registry change as for WIN 95 and also disable the new file sharing and locking semantics and disable the write-behind caching for all drives.

WIN NT 4 (including Small Business Server)

NT server:

HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\LanmanServer\Parameters
EnableOplocks = 0

NT client:

HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\LanmanWorkstation\Parameters
UseOpportunisticLocking = 0
UtilizeNtCaching = 0
UseLockReadUnlock = 0
UseUnlockBehind = 1 

95/98 clients:

HKEY_LOCAL_MACHINE
System\CurrentControlSet\Control\FileSystem
DriveWriteBehind = 0 

This is not meant to be an exhaustive guide. See for example Microsoft knowledge base articles Q142803 and Q174371.

Novell

Novell Sites running Novell 4.0 or later should obtain latest patches. Older sites running should download a fix from the Novell site to disable the cache which has also corrupted site data.

If you are using Client32, ensure version 2.2 or later. Set File Cache Level to Zero.

WIN 95/98 running Novell client:

HKEY_LOCAL_MACHINE
Network\Novell\System Config\Netware Dos Requester
Cache Writes = "OFF" 
Opportunistic Locking = "OFF" 

WIN 2000 and XP

Issues are generally similar to NT. Entries should be made to both server and workstation:

2000 Server:

HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\MRXSmb\Parameters
OplocksDisabled = 1

HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\lanmanServer\parameters
EnableOplocks = 0

2000 or XP Client:

HKEY_LOCAL_MACHINE\
System\CurrentControlSet\Services\lanmanWorkstation\parameters
UseOpportunisticLocking = 0

If 2000 or XP is being used simply as workstation on a peer network, we would still recommend making the above "client" change.


More resources

More general references on this issue:

130922
124916
129202
126026
219022 (NT and Small Business Server)
296264 (configuring opportunistic locking in Windows 2000 - server and workstation)

See also Novell's web site (www.novell.com). There are also numerous other references to this issue on the web.