Disable Opportunistic Locking (GA-TaxPro on Network Servers)

Edited

Understanding Opportunistic Locking (Oplocks)

How Oplocks Work

Opportunistic locking (oplocks) is a Windows networking feature that is designed to improve performance by allowing clients to cache file data locally. This reduces network traffic and speeds up application response times. When a client requests an oplock, it can read and write from its cache without notifying the server immediately. Multiple clients can access the same file via their caches, but changes made by one client may not be reflected to others until they sync with the server.

Known Issues Associated with Oplocks

While oplocks can significantly benefit small files, they can complicate matters when larger database files are accessed simultaneously. Particularly in multi-user environments and 'roll forward' process with GA-TaxPro. The main issue include:

  • Performance Issues: Managing oplocks can introduce latency due to synchronization needs when clients receive break notifications.

Solution: Setting LeasingMode to None

To mitigate these risks while using modern SMB protocols (SMB2/3), administrators can disable oplocks by setting the LeasingMode parameter to None via PowerShell. This approach avoids reverting to the outdated SMB1 protocol.

Steps to Disable Oplocks Using PowerShell

  1. Open PowerShell as an Administrator.

  2. Create or Modify an SMB Share: with powershell

    Set-SmbShare -Name "YourShareName" -LeasingMode None

Replace "YourShareName" with your actual SMB share name.

Benefits of This Approach

  • Improved Reliability: Users can work without risking disruptions.

  • Continued Use of SMB2/3: Organizations still benefit from modern features while maintaining a stable environment since this only modifies our SMB Share.

In summary, GA-TaxPro users should manage opportunistic locking by configuring SMB shares with LeasingMode set to None, ensuring data integrity and smooth operations.


Reference: Other PowerShell Commands

To list all SMB shares on your server:

Get-SmbShare

If the share does not appear in the list, you may need to create the share.

You can create the share:

New-SmbShare -Name "GATAXPRO" -Path "C:\Shares\Group$\Apps\S_TAXGAW" -FullAccess "Everyone"

//please adjust path as needed

Modify SMB share:

Set-SmbShare -Name "GATAXPRO" -LeasingMode None

Double-check this is done correctly

Get-SmbShare -Name "GATAXPRO" | Select-Object LeasingMode

LeasingMode should be None now