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)

Batch jobs never stop executing

(0) ShareShare
ReportReport
Posted on by

Dear all AX Experts,

i'm using dynamics ax 2012 R3 CU9, i make a new batch job that will upload a file from my directory to the AP invoice journal, i have make this batch job for 6months, all going right until last week, last week AX automatically make new batch jobs like journalizing product receipts, and 1 other batch job, the batch jobs automatically executing when sunday and when monday i want to use my batch job (upload AP Invoice journal), the batch job can't run because there are 2 batch jobs is executing from sunday. i have restart my AOS service and my server but the batch jobs still executing, and i decide to delete that batch job using SQL, now there are no batch jobs  (journalizing product receipts and other), but when i executing my batch job (uploading AP Invoice journal), the batch job never ending, what should i do? any sugesstion?

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,284 on at

    Hi christoper,

    You may want to check if there are blocking transactions in SQL www.mssqltips.com/.../how-to-identify-blocking-in-sql-server

  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    what about database performance? normal or not?

    try to install trace parser to check methods and classes with time executed

    try to use execution query plan in SQL also

  • Community Member Profile Picture
    on at

    dear ievgen thanks for your reply, i have check to SQL and there is no blocking transactions

    dear Mahmoud Hakim thanks for your reply, i will try your suggestion and i will inform you later

  • Community Member Profile Picture
    on at

    For additional informations:

    I'm using microsoft Dynamics AX 2012 R3 CU 9

    what i have done before to try solving this issue :

    - Compile (there is no error)

    - Full CIL (there is no error)

    - when i run the job manually it works properly (uploading file.csv to the AP invoice journal)

    sometimes when i restarting the AOS service it's stuck on stopping status and i must to kill the task to make the AOS service stopped but i must start the AOS service manually

    this is the screenshoot of my issue (stuck in executing) ,in the real the batch job didn't work (didn't inserting the file.csv to AP invoice journal) but the status "executing" without working in anything

    error-batch.jpg

    when i go to the event viewer, this is the error log :


    Object Server 01:  Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
       at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)
       at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.InsertInto(IntPtr targetTable, List`1 fields, List`1 ops, IntPtr sourceTable)
       at Microsoft.Dynamics.Ax.Xpp.Common.InsertInto(FieldList fieldList, Common sourceCursor)
       at Dynamics.Ax.Application.BatchRun.serverProcessFinishedJobs(Boolean forceProcessing, Boolean ) in BatchRun.serverProcessFinishedJobs.xpp:line 322
       at Dynamics.Ax.Application.BatchRun.serverProcessFinishedJobs(Boolean forceProcessing)
       at BatchRun::serverProcessFinishedJobs(Object[] )
       at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
       at BatchIL.checkFinishedJobs(Boolean forceProcessing)
       at BatchIL.threadFunc(Object threadArg)

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Do you have exception handling for CLR error and deadlock in your batch job(class), If not please include it(as below) to capture the error during the batch process.
    Also, please check whether AOS user account has sufficient access rights to the folder and UNC path(like \\servername\Folder) is used to fetch the file.

    System.Exception ex;
    
    catch (Exception::CLRError)
        {
            ex = ClrInterop::getLastException();
    
            if (ex != null)
            {
                ex = ex.get_InnerException();
                if (ex != null)
                {
                    error(strFmt("%1", ex.ToString()));                
                }
            }
    
            retry;
        }
    
    catch (Exception::Deadlock)
        {
            retry;
        }

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