Opportunistic Locking turned off update

63 views
Skip to first unread message

Mark Bannister

unread,
Mar 25, 2025, 8:59:38 AMMar 25
to TheDBCommunity
I've been running an experiment with opportunistic locking turned off on our Samba server and workstations.
It's been off about a month now. So far we are not having any issues.  
Some caveats:
  • Most our data is adding records, not modifying existing records.  Seldom would two users ever try and modify the same record at the same time.
  • Low user count with only about 3-4 people are ever active at a time.
  • Not sure that it matters, but I use transactions for almost all changes and only a few forms allow direct editing of the underlying data.
I did do some testing first trying to cause corruption.  I got a couple of odd lock messages but nothing else.

Steven Green

unread,
Mar 25, 2025, 9:16:05 AMMar 25
to TheDBCommunity
but it's supposed to be turned off, yes?

Mark Bannister

unread,
Mar 25, 2025, 9:17:53 AMMar 25
to TheDBCommunity
Ohh, good grief.  SMB1 protocols, not locking.  Arrggh.
I turned off SMB1

Randall Haines

unread,
Mar 25, 2025, 1:45:51 PMMar 25
to TheDBCommunity
In our experience, turning off SMB1 on the client and/or server side, in a Windows environment, will result in occasional occurrence of a "No more files" error message, which can lead to data corruption.
We had always believed SMB1 was required for Paradox tables on a network share, based on everything we had read on the newsgroups.
However, recently we have discovered that SMB1 can be removed and SMB2 will work fine. 
This "No more files" error can be remedied with a client side registry change for SMB2 Client Redirector Cache
HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\DirectoryCacheLifetime=0 (DWORD)

Read about the setting here:
SMB2 Client Redirector Caches Explained
Begin excerpt:
Directory Cache [DWORD] DirectoryCacheLifetime
This is a cache of recent directory enumerations performed by the client. Subsequent enumeration requests made by client applications as well as metadata queries for files in the directory can be satisfied from the cache. The client also uses the directory cache to determine the presence or absence of a file in the directory and uses that information to prevent clients from repeatedly attempting to open files which are known not to exist on the server. This cache is likely to affect distributed applications running on multiple computers accessing a set of files on a server – where the applications use an out of band mechanism to signal each other about modification/addition/deletion of files on the server.

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters
Default setting = 10 seconds

Recommendations
If you suspect metadata caching in the redirector as cause for misbehaving applications, disable the caches in the following order to determine which of these caches is affecting the application. Disabling the File information cache can have significant effect on client performance and show an increase in the number of metadata requests that are sent to the server.

Directory cache, by setting DirectoryCacheLifetime to ZERO.

File Not Found cache, by setting FileNotFoundCacheLifetime to ZERO.

File information cache, by setting FileInfoCacheLifetime to ZERO.
End excerpt:

We have not had a need to alter FileNotFoundCacheLifetime or FileInfoCacheLifetime in our environment.
We use Paradox 9 SP3.

The accepted answer in this post is what pointed us in the right direction:

We have not noticed any perceivable delay when browsing the network folders after disabling "DirectoryCacheLifetime", however it could conceivably be noticeable if you where browsing over a slow network connection like over a VPN. 

Here are a few more references about the "No more files" error that we found:

Regards,
Randy Haines

Steven Green

unread,
Mar 25, 2025, 2:04:55 PMMar 25
to TheDBCommunity
Randall, great info thanks.. I think the "no more files" issues might be more varied than that, as complex as it already seems there.. I get it in p10 and p11, on network and stand-alone, on win7 and win10.. almost always, hitting whatever it was, again, will usually work

DIMIM

unread,
Mar 28, 2025, 3:39:40 AMMar 28
to TheDBCommunity
  Hi Randall,

would be nice, if smb1 could be easy replaced with smb2.
As I know, Pdox don't need the smb1. BDE does.

Just a hint:
The error message "No more files" comes from BDE.
You can remove it with BDEadmin.exe:

    Configurations | System | Init | MAXFILEHANDLES

and if you want to be shure , the following key too:
 
    Configurations | Drivers | Native | Paradox | MAXFILEHANDLES

and set a higher value. Valid values are between 5 - 4096. Default is 48 (this is not enough). Higher values need more memory, so it's not necessary good, to use the biggest values.
Set the value e.g. to 255 (REG_DWORD 0x000000ff) and proove, if the error message disappear.

As I've used the value 80, I got the same message. Then I've set it to 255, the problem disappear.
I myself use now 1024 (REG_DWORD 0x00000400) and have as long not a problem with it.


My registry settings for oplocks are since years (on each network-pc, where Pdox is used):

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\EnableOplocks                      0  (REG-DWORD)
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\EnableOplocks            0  (REG-DWORD)
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb\Parameters\OplocksDisabled                               1 (REG-DWORD)

and now I've added

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\DirectoryCacheLifetime            0  (REG-DWORD)

by now, no changes, works ok too.




Remark: To be shure, that it works properly, search the registry for the value:

    MAXFILEHANDLES

and proove for each one, if the key has set the same value as you set with BDEadmin.exe. If not, change the registry value.


BTW.: I had problems to change registry values with OPAL (e.g. P9 on Win10). getRegistryValue works Ok. setRegistryValue don't. Therefore I wrote my own get-/setRegistryValue with VisualStudio (C#) and now it works.


If Pdox (since P9) will work without problems with smb2 too, then Pdox will be alive for at least next 10 years.

Greetings.

Ivan
Dátum: utorok 25. marca 2025, čas: 18:45:51 UTC+1, odosielateľ: Randall Haines
Reply all
Reply to author
Forward
0 new messages