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.

posted @ 2013-07-26 14:42  szlailai  阅读(221)  评论(0编辑  收藏  举报