Can't catch exception inside AIF service

后端 未结 1 1151
盖世英雄少女心
盖世英雄少女心 2021-01-07 06:21

I have created an AIF service in dynamics AX 2012, when I tested it by calling the entrypoint method from a job, it worked fine, but when it is deployed en the calls are com

1条回答
  •  伪装坚强ぢ
    2021-01-07 06:39

    Solved,

    AIF has one big transaction somewhere deep in the core code and an own try catch.

    So when you throw an error inside AIF sevice it is going to abort the outer transaction and go to staight to the AIF catch clause, skipping all others.

    That's why I couldn't catch it. Solution could be to commit AIF transaction, run your code and before return begin new transaction.

    0 讨论(0)
提交回复
热议问题