ax 的错误处理范例

#OCCRetryCount
;
    try
    {
        ttsbegin;
        //example as insert or update or delete record
        ttscommit;
    }
    catch(Exception::Deadlock)
    {
        retry;
    }
    catch (Exception::UpdateConflict)
    {
        if (appl.ttsLevel() == 0)
        {
            if (xSession::currentRetryCount() >= #RetryNum)
            {
                throw Exception::UpdateConflictNotRecovered;
            }
            else
            {
                retry;
            }
        }
        else
        {
            throw Exception::UpdateConflict;
        }
    }
View Code

ax 中有try catch.

原文地址:https://www.cnblogs.com/sxypeace/p/3217066.html