On NAV Techdays 2016 in Antwerpen (Belgium) Microsoft demonstrated a beautiful new feature. Microsoft Dynamics NAV 2017 now offers ‘Database Deadlock Detection and Monitoring’. If NAV 2017 detects a deadlock it will rollback one of the transactions.
If you run the NST under a serviceaccount you need to apply some extra configuration to make this work:
- Alter any event session
- Grand View Server State
Go to the properties of your serviceaccount in SSMS and go to the ‘Securables’ tab:
It’s also possible by executing some T-SQL:
GRANT ALTER ANY EVENT SESSION TO [CONTOSO\sa_nav]
GRANT VIEW SERVER STATE TO [CONTOSO\sa_nav]
If you don’t do this you will notice errors like this in your application Log:
Server instance: NST2017-RTM
EventTime: 12/05/2016 16:16:04
Message <ii>Deadlock monitoring feature is enabled but current SQL server user does not have ‘VIEW SERVER STATE’ or ‘ALTER ANY EVENT SESSION’ permissions for the database: NAV2017RTM. Please grant both of those permisions in order to use this feature.</ii>
By Default DeadLock Monitoring is already enabled on the NAV Service Tier (NST):
As a Technical consultant I need to regularly install new NAV software for our customers. After installing I always try to check if web services are also working. In NAV 2017 I check at least three things:
1. Call the SOAP URL
First link contains the hostname. Second link contains the FQDN. Always test with both to ensure it’s working flawless!
2. Call the ODataV3 URL
3. Call the ODataV4 URL
Please note: the links of course only work in my Lab environment!
The SOAP URL shows the WSDL so that’s okay:
Now the ODataV3 URL shows the following response:
This isn’t the response I want to see, however… If I show the source of the page (F5) I see the OData output! So this works also! Normally this is a good thing: Internet Explorer is processing the output as an RSS feed. In this case I don’t want that, so the first thing we should do is to disable this:
Go to Internet options > Content > Settings and disable ‘Turn on feed reading view’. Close the browser and retry.
Now we see the OData response immediately! It took me some time to figure this out so I hope I can save you some time with this handy info! To test the ODataV4 URL there is also a problem with the browser. I will investigate this and share my findings soon!