• +44 (0)20 3772 1081
  • sales@sqlmantratools.com

Tri-state Locking to Improve Concurrency of Business Central

Recently in BC23, Microsoft has slipped through a feature called “Enable Tri-State locking in AL”. Having this feature is like hitting a gold mine when it comes to performance improvement, especially increasing the concurrency of the Business Central system. There is relatively less advertisement about this feature, compared to the benefit it brings, from Microsoft. For years we have struggled with the “pessimistic locking” regime of Dynamics NAV and Business Central. This even goes as far as Navision (the predecessor of Dynamics NAV and Business Central). This locking behaviour will lock tables and rows which should not be locked in reality, leading to lock escalations, blocking and deadlocks as concurrent sessions run into each other’s locked ranges in tables are indexes.

There were many failed attempts to tackle this problem by Microsoft / Navision in the past. “Always rowlock” settings in the database tab is an example. Some of you may remember this setting from those days (see below).

Always Row Lock setting in Dynamics NAV & in Navision

The fundamental problem is when a row is modified or deleted any subsequent data retrieval from the same table will have a “UPDLOCK” hint added to the select query, while the transaction is active. Due to the blunt nature of this hint which is added by the CSIDE (API between NAV application server and SQL Server), it leads to significant locking. This locking regime is honestly an over kill. As performance tuning experts in the Dynamics industry, for the past 25+ years we have to face the full brunt of these issues to deliver better, faster systems to accommodate more concurrent users to the industry and to our clients.

The Tri-state locking change has finally addressed the root cause of this problem, selectively issuing the “UPDLOCK” lock hint while reading the rows. There is an article on the Microsoft website, explaining the change. This is nicely summarised in the diagram below. It is fairly easy to activate this feature through “Feature Management” page in Business Central. This feature will be automatically enabled in BC25 onwards. We will encourage all Business Central customers to enable it for better performing Business Central System. Wish we could have had this earlier.

Comparing Table locking in Business Central - With and Without Tri-state Locking

Tri-state Locking a hidden gem in Business Central

SQLMantraTools Logo

SQL Mantra Tools will monitor Dynamics NAV & Business Central SaaS Performance in Microsoft cloud 24/7 and will give insights to pinpoint the performance pain points. Our software will give the A/L & CAL code as well as the BC & NAV user details along with the SQL Code which was causing the performance issues in both SaaS and On-Prem platforms . This is the unique feature of our software compared to many others.


SQL Mantra Tools will also analyse Microsoft SQL Server key setup parameters as well as its resources along with application setups and will check them against the best practice guidelines and will suggest the necessary steps to remedy them.


Our Maintenance routine will proactively maintain your ERP system, such as Dynamics NAV & Business Central, free from any performance issues, optimising its size, minimising the database growth.