Deadlocks mystery

chucmachucma Member Posts: 7
Hi there.

I have a customer on version 4.00 (SQL not native). We have written a codeunit that Reopens and Releases existing sales orders one-by-one. At the office it runs perfectly (also SQL at my office), however onsite they get the error from Navision:

"Your activity was deadlocked with another user modifying the Sales Line table. Start again."

I am new to SQL and understand the basics of deadlocking - but if it was due to a C/Side coding fault then shouldn't it also be happening at the office?

Regards,

Adrian.
Adrian Grobler

Comments

  • kinekine Member Posts: 12,562
    1) Are you using same version of 4.00 on both sites and which one? 4.00 or 4.00SP1?
    2) The data are same or there are just same objects but data can be different (for example because the system is used in another way)
    3) You need to check errorlog when trace 1204 is enabled to catch the deadlocks into the log. There you can see more details about the deadlock (which sessions are in deadlocks etc.)
    4) For how to solve deadlocks see performance troubleshooting guide...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • chucmachucma Member Posts: 7
    Answers to questions:
    1 - we are using 4.00 withou SP1 on both sides
    2 - data is from a recent backup (only a day or two behind at the office)
    3 - will try Traceflag1204, it seems to give a lot of high level info though that I battle to relate to Navision
    4 - we are also currently going through the guide and trying to cover everything in it

    Thanks for the quick responses, :D
    Adrian Grobler
  • DenSterDenSter Member Posts: 8,307
    It's probably not your routine that deadlocks, but other people doing other things in the same table while your routine is running.
Sign In or Register to comment.