Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Starting batch job crashes the client

$
0
0

Hi,

I'm trying to run a Batch job with many tasks, but my AX client crashes when I run the job to schedule the batch job and it's tasks.

I checked, AOS is set as batch server, so no issues with that.

Batch class:

class ParallelBatchTest extends RunBaseBatch
{
    #define.CurrentVersion(1)
    int batchNo;
}

public void new()
{
        super();
}

public container pack()
{
    return conNull();

}

private void parmBatchNo(int _batchNo)
{
        BatchNo = _batchNo;
}

void run()
{
    batchtest batchtest;

    batchtest.BatchNo=BatchNo;
    batchtest.insert();

}

public boolean unpack(container packedClass)
{
    return true;
}

public static ParallelBatchTest construct(int _batchNo)
{
    ParallelBatchTest  c;
    c = new ParallelBatchTest();
    c.parmBatchNo(_batchNo);
    return c;
}


Job to schedule batch and it's tasks:

static void batchTest(Args _args)
{
    BatchHeader                     batchHeader;
    ParallelBatchTest               parallelBatchTest;
    BatchInfo                       batchInfo;
    int                             i,taskCount=5;


    batchHeader = BatchHeader::construct();
    batchHeader.parmCaption(strFmt('Batch JOB 1'));

    for (i=1; i <= taskCount; i++)
    {
        parallelBatchTest = ParallelBatchTest::construct(i);
        batchInfo = parallelBatchTest.batchInfo();
        BatchInfo.parmCaption('BatchTest'+int2str(i));
        batchHeader.addTask(parallelBatchTest);
    }
    batchHeader.save();

    ttsCommit;
    info('Done');
}


Table:

AX CLIENT CRASH:

Will appreciate any tips to resolve the issue.


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>