Hi guys,
I spend some time searching the forum for any relevant issues but did find exactly what I need.
So I am having a SQL 5.01 NAV and my client posts about 800-1000 invoices daily, which brings a lot of deadlock messages. I know that usually when having a deadlock problems I should try to optimize the problematic process but in this case I think that there are just too many invoices.
Because the users usually are scared when they receive the deadlock messages and also it is very annoying, my idea is to make some kind of queue so that when the user try to post an invoice not to get the deadlock error but just to wait until the tables are unlock and then automatically the posting is finished.
I already discussed this solution with the client and they are ok, however if you have any better ideas you are welcome.
Thanks in advance!
0
Comments
If you want closer to real time as you are describing then a queue is the way to go. I'm not sure how to tell if the table is locked, though. I don't think that that is an error message that can be trapped using the standard IF CODEUNIT.RUN THEN syntax.
Your idea of a queue is allready implemented in SQL server (since the first version), so there is no need to "invent" it again. If your customer really experiences deadlocks I'm pretty sure it's due to some customization.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The solution with the night posting won't work for us since the client has also mobile devices which at the end of the day should be loaded with the available quantity of the items. I also thought of the If Codeunit.run then syntax solution but didn't try. I wanted to see if any better solution will come to me.
Yesterday I tested again the scenario with W1 db and localized BGR db and really I didn't got a deadlock but a lock error about GL entry table and that only if Automatic Post Cost is turn on. However I am pretty sure that when I discovered the problem I had received deadlock errors. Today I will make some tests again (this time with clients db) and let you know the results.
10x
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
There's your troublemaker. Such adaptations with off-line terminals almost always cause trouble - speaking from experience. Check that add-on how and where it puts the transactions of those terminals.
I cannot use this also because the client wants to have actual cost at any time since they are monitoring some reports. I know that it is not useful but also the Analysis by Dimension is updated during posting which also slow down the postings.
There is no add-on. The transactions(invoices) are imported as text files and its done manually.
I am considering to use additional table which I will lock just after the posting is started and will unlock just after the posting is finished. And every following posting will first check if it is locked (then will wait maybe I will use sleep function) and if not the posting will go.
I will check if this will work next week and let you know.