xSession.currentRetryCount Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Counts the number of times a try block has been retried after a deadlock, an update conflict, or another exception.
public:
static int currentRetryCount();
public static int currentRetryCount ();
static member currentRetryCount : unit -> int
Public Shared Function currentRetryCount () As Integer
Returns
The number of times that the try block has been retried.
Remarks
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;
}
}