Share via


xSession::currentRetryCount Method

Counts the number of times a try block has been retried after a deadlock, an update conflict, or another exception.

Syntax

client server public static int currentRetryCount()

Run On

Called

Return Value

Type: int
The number of times that the try block has been retried.

Examples

The following example uses the currentRetryCount method to test how many times that a transaction has been retried to determine the exception handling for a CUD transaction.

catch (Exception::UpdateConflict) 
    { 
        if (appl.ttsLevel() == 0) 
        { 
            if (xSession::currentRetryCount() >= #RetryNum) 
            { 
                throw Exception::UpdateConflictNotRecovered; 
            } 
            else 
            { 
                retry; 
            } 
        } 
        else 
        { 
            throw Exception::UpdateConflict; 
        } 
    }

See Also

Reference

xSession Class