web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to handle wait_type LCK_M_IX in DB monitor

(0) ShareShare
ReportReport
Posted on by 334

Hi, Experts:

I have a couple question about batching processing, hope someone can help to answer

Firstly , As title said, What can I do when I see LCK_M_IX in SQL server's activity monitor, when batch is executing?

It seems the batching would  hang forever if I do nothing, so I should just cancel the batch then check the SQL statement to find out the cause?

If I cancel the batch, should I wait for the status turn to cancelled (sometimes it takes too long to change or won't change at all) or Is it OK I can just restart AOS to enforce the status change? Would it has any side effect to restart AOS?

Secondly, How do I know if a batch job is still running? Is there process or session ID i can check?

I have google these questions for a while. However there are no complete result. so Hope here someone can provide an answer to let me reference,

Thanks again

Quatrani 

*This post is locked for comments

I have the same question (0)
  • Brandon Wiese Profile Picture
    17,788 on at

    There was a kernel hotfix to address batch jobs talking a long time to arrive at a canceled status.

    Below is the description for the hotfix on AX 2012 R3 that was released on 2/4/2016.  Your version and release date may vary.

    While this may not have anything to do with your lock issue, have you tested the hotfix to solve the batch status issue?

    Also, you can get quite a lot of good data regarding locks from SQL Server using DMV's and even some of the built-in reports.  Try to dig in a bit and get more information, such as what resource is locking.

    KB 3124214

    Batch jobs are stuck on canceling until another batch job completes successfully
    Product and version
    Microsoft Dynamics AX 2012 R3
    Release: CU11
    Fix type: Kernel hotfix
    PROBLEM
    Batch jobs are stuck on canceling until another batch job completes successfully.

    DESCRIPTION OF CHANGE
    The changes in the hotfix change the way batch job statuses are updated in a way that ensures the batch job statuses are correct.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    A batch job execution is tracked by it's status in Batch and BatchJob tables.

    If you would like to correlate the SQL Server process IDs with AX users/threads, this Microsoft post could help:

    blogs.msdn.microsoft.com/.../finding-user-sessions-from-spid-in-dynamics-ax-2012

    Also you have the sp_axwho stored procedure in the AX database that you could execute in management studio.

  • JCHI Profile Picture
    334 on at

    Hi, Brandon:

    thank you for the quick reply and precious answer

    However, It is a pity I am using AX2012 CU7 and can not be upgraded now.

    I'll keep in mind what you said about the hotfix once I can use it.

    Thanks a  lots anyway!

    Quatrani

  • Tommy Skaue Profile Picture
    Moderator on at

    Hi

    Since the lock is an attempt to create an exclusive lock on table pages, what you can try to do before applying the hotfix is some index maintenance.

    You can start by updating the statistics for the table which is locked. This should be a less intrusive operation, and may help the SQL Server to be able to get around the locking situation until you get the code change put in production. Having a good index maintenance is also extremely important.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Also have you implemented the recommended SQL Server Trace Flags for Microsoft Dynamics AX? There are Microsoft publications about this that you could easily find. There is one trace flag that helps with lock escalations.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans