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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Batch job stuck with executing status.

(0) ShareShare
ReportReport
Posted on by 471

Hi everyone

I am using Ax 2012 R3

I am working on a batch job in which I have to implement the multi threading concept in it. I have implemented it and it is working fine. But, when I run this for bigger pool of data, I missed adding code to control the number of threading and it lead to creation of lakhs of threads and the batch job is stuck in "Executing" state.

I have tried to put it in waiting state to stop it but no luck. I have also tried to restart the services and it didn't work. I have fixed the code part. But, I am not able to stop this which is not allowing me to run CIL as well to take the effect of new code change.

Please suggest me what I need to do to stop this batch job.

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Verma MC,

    Have you tried to cancel the batch job by changing the status to "Cancelled"? When the job is cancelled, you can delete the job and can add a new batch job which would have your latest code.

  • Harshal Nayak Profile Picture
    on at

    Hello Chiranjeevim7,

    If you have access to the database then can you try to run SQL query and change the status from backend database on the batch job table . below are the status for your reference.

         

                                                 BATCH.status = 1 then 'Waiting'

                                                 BATCH.status = 2 then 'Executing'

                                                 BATCH.status = 3 then 'Error'

                                                 BATCH.status = 4 then 'Ended'

                                                 BATCH.status = 5 then 'Ready'

                                                 BATCH.status = 6 then 'Not Run'

                                                 BATCH.status = 7 then 'Cancelling'

                                                  BATCH.status = 8 then 'Cancelled'

    Regards,

    Harshal

  • VermaMC Profile Picture
    471 on at

    Thanks for the replies.

    I have tried to cancel the batch job. But, it got stuck without responding when I try to change the status to Canceling.

    So, I have run a SQL query and updated it to Cancelled. However, the tasks under the batch job are still executing. So, it is not totally getting stopped.

    Let me know if I can do anything further on it.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi,

    Please try restarting the AOS service if it is stuck at cancelling. That should change the status back to Cancelled killing all the threads.

  • VermaMC Profile Picture
    471 on at

    No, it was not stuck in Canceling. It was stuck in Executing and it remained the same even when I tried to change the status to canceled. The restart didn't help and remained in the executing.

  • Harshal Nayak Profile Picture
    on at

    Hello Verma MC,

    is it still showing the same behavior or the task status got cancelled as well?

  • VermaMC Profile Picture
    471 on at

    Let me rephrase if I am communicating wrong.

    I have tried to update the batch job status to Cancelling and it got stuck. So, I updated the batch job status through SQL to Cancelled. However, the multi threading tasks of that batch job are still executing and many are in Ready state as well.

    I even tried to put the batch job to Withhold thinking that it would stop the execution of the tasks beneath it but no luck as it just gets stuck there when I tried to change it.

  • Harshal Nayak Profile Picture
    on at

    Hello Verma,

    Have you tried restart the AOS ?

    regards,

    Harshal

  • AnithaEswaran Profile Picture
    2,032 on at

    Hi Verma,

    I`ve posted the solution in my blog.

    anithasantosh.wordpress.com/.../

    This is applicable for D365FO as well.

    You can get access to UAT SQl Db from LCS and execute the given SQL statements. That should solve your issue.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans