Database Dead-lock Detection and Monitoring in Dynamics NAV 2017

Recently, one of our distribution customers experienced dead-lock during posting of Sales order or purchase order. Because of this dead-lock their operation was delayed, one need to wait for another person to complete the posting, if the user try to force through the Posting part by clicking the Post action button, they will receive “Table xxx” is locked by another user. “Dead-lock” affects their sales, as the customer did not want to wait the user to finish posting the sales order.

What “dead-lock” means in Navision? Dead-locks can prevent users from completing tasks in the Dynamics NAV client. A dead-lock occurs when two or more processes or transactions block each other from continuing because each has locked a database resource that the other transaction needs. SQL Server handles dead-locks by terminating and rolling back transactions that started after the first transaction.

In Dynamics NAV 2017, there is a new feature where the system logs this “dead-lock” and captures information related to this dead-lock, such as what is the query or scenario could trigger the block or how long the process happens. To enable the logging, “Enabled Dead-lock Monitoring” field on the Dynamics NAV Administration – database tab has to be “ticked”.

After Enable Dead-lock monitoring has been setup, and the dead-lock happens, you can view the information related to the dead-lock process.