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.
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.
Hello Verma,
Have you tried restart the AOS ?
regards,
Harshal
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.
Hello Verma MC,
is it still showing the same behavior or the task status got cancelled as well?
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.
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.
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.
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
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156