Skip to main content

Top Two Problems for Dynamics NAV Classic Client: Table Locks and Time

Top Two Problems for Dynamics NAV Classic Client: Table Locks and Time

Microsoft Dynamics NAV Classic Client Problems - Table Locks
Two of the biggest complaints I hear from clients who are still on NAV versions prior to NAV 2013 are the headaches caused by table locks, and the time required to post sales orders. If you are one of those people suffering from either (or both) of these issues, keep reading, there is hope. With NAV 2017 – provided your custom code is written properly – the chances of either of these being a problem are pretty close to zero.

Dimensions

Prior to NAV 2013, each dimension to be recorded for a document had to be written to a table as a single record. Therefore, if you have two header dimensions and three line dimensions, a sales order that had 10 lines would create 32 records. When the sales order was posted, it would create another 32 records for the sales shipment, and another 32 records for the sales invoice.  Moreover, to add to the processing, the original records with the sales order have to be deleted when it is deleted during the posting. Therefore, for that one document, you end up with 128 records processed.
From NAV 2013 and forward, only one number, called a Dimension Set ID, is written, and it is written only once to the header. Each line can have a different dimension set, so you get one number written to each order line. If we use the same example as above, that’s one dimension set ID for the header, one for each line, and it is stored on the existing records. No additional records are created. When you post the document, the dimension set ID is transferred in one fell swoop to the posted documents and lines. Again, no additional records. When the sales order is deleted, there are no external records to remove. Imagine the amount of disk space that saves. 
Depending on the extent to which dimensions are used, we have seen a 10-30% decrease in database size during upgrades simply due to the new dimensions management restructure. That is something to consider if you have a rapidly growing database. To see a one-terabyte database shrink to 700 gigabytes in an upgrade is a reason to celebrate.

Dimensions, Table Locks, and Slow Performance

Table locks are issued in code with the LOCKTABLE function. This prevents multiple users from writing to the same record at one time. This collision of data would create all sorts of issues in NAV, so NAV prohibits it.  When posting routines are slow, typically due to disk operations (like writing dimension records), there is a greater opportunity for a user collision to occur. When this does happen, a message is sent stating that another user has the table locked, and the operation cannot be performed. It is sort of like a revolving door. The faster it moves, the more people (or transactions, in this analogy) can enter. However, if anything slows down your revolving door (processing), your transactions are likely to hit a closed door. By using the new dimension set ID design, NAV has increased its processing speed, which provides a decreased opportunity for those user collisions to occur.

Microsoft Dynamics NAV Going Retro

Think back a few years to the introduction of NAV 2009. Microsoft did not do us any favors when they took away the ability to see what job was locking a table back in NAV 2009. Without the ability to see the issue quickly, we had to rely on SQL traces and things of a far more technical and time-consuming nature to determine the cause of the lock. Fortunately, Microsoft seems to have relented, and yes, NAV 2017 once again includes the ability to see who is causing a job to be locked.
To illustrate, I have created a lock on the Customer table. Then I have gone into a customer record, and tried to update the name.  As you already know, that is not possible with a table lock, and so the error below is given:
Dynamics NAV Table Lock Error on Customer Card
Figure 1 - Error Message on Customer Card
Now in this example, of course, I know who created the lock. However, imagine in a database of 100 active users this occurs, and perhaps even on the General Ledger Entry table. There is no easy way in versions from NAV 2009 through NAV 2016 to find the cause of the lock. Even in versions before 2009, when the lock occurs and you can find out who it is, it is a huge headache to resolve because the processing speed often makes this a recurring issue. In walks our hero, NAV 2017. 
In the NAV 2017 development client, simply choose Tools – Debugger – Database Locks.  Any, and all, locks that are currently found in the database are shown.  The image below shows just how simple it is to determine the cause of a table lock.
Dynamics NAV 2017 Database Lock Feature
Figure 2 - Dynamics NAV 2017 shows the cause of the table lock
How do you end the lock? Upgrade your old database, and not only will you have less opportunity for table locks, but you’ll decrease the size of your database immediately when those dimension records are converted to dimension set IDs. 

Comments

Popular posts from this blog

Quick Fix Visual Studio displaying NAV Report Layout as XML

I got this issue with Visual Studio 2015 Enterprise Edition.  Every time I open a Dynamics NAV report layout in Visual Studio, RDLC is rendered as XML file instead of visual layout with all the fields and tool boxes.  How the report layout looks:  FIX : In order to fix the issue you need to install  "Microsoft SQL Server Data Tools" .  To install "Microsoft SQL Server Data Tools" you need to go to  Control Panel   ->  Programs and Features  - >  Microsoft Visual Studio <Edition>  -> Change Or you can re run the installation setup.  From the features list, enable "Microsoft SQL Server Data Tools" option and proceed.  Once the installation is completed you are good to go. This time report layout will open in correct design layout.  Hope this helps you to resolve the issue. happy designing.  Please provide your feedback with a comment.  Thank you and Regards, +256775120005 Kairo Okello Dan ERP Solutions Consultant

The Difference Between Microsoft Dynamics NAV and AX

The Difference Between Microsoft Dynamics NAV and AX Microsoft Dynamics offers a variety of ERP solutions. You might say there is a solution for every purpose and every industry. Two of the offerings,  Dynamics NAV  and  Dynamics AX (now part of  Dynamics 365 ) share some of the same features so you might wonder: ‘what are the differences and which is right for my organization?’ Both ERP solutions are highly customizable, available in and adaptable to many languages and currencies used around the world. The two solutions can also be employed in a central location or across diverse satellite locations and are designed to grow as a business grows. Their industry-specific functionality can assure compliance with local and regional requirements. In short, both solutions could rightly be described as comprehensive and well equipped to manage complex requirements of supply chain and inventory. So, what is the difference? Is one better than the other for your particular organiz

How to install a Microsoft Dynamics NAV cumulative update

How to install a Microsoft Dynamics NAV 2018 cumulative update Introduction This article describes how to install a cumulative update for Microsoft Dynamics NAV 2018. You have to recompile all objects after you install a cumulative update. A cumulative update is a cumulative set of files that includes all hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2018. A cumulative update includes files that are separated into the following folders: APPLICATION DVD See  Upgrading the Data to Microsoft Dynamics NAV 2018  for details. How to install the cumulative update files APPLICATION The APPLICATION folder includes the following files: AccumulatedChangeLog.<Locale>.<Build No.>.txt Changelog.<Locale>.<Build No.>.txt CUObjects.<Locale>.<Build No.>.fob Objects.<Locale>.Objects.<Locale>.<Build No.>.txt To install the application files, follow these