Click or drag to resize
SqlExecutionHelperExecuteWithDeadlockRetryInternalTResult Method

Executes the given executionFunc while catching exception resulting from the execution. If the exception thrown contains SqlException as its inner exception and the Number equals to 1205 (deadlock), the execution is retried.

The execution is never retried if IsInTransaction indicates the execution is part of a transaction.

If the retry limit is reached, the exception resulting from the last execution is re-thrown.

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax
C#
protected virtual TResult ExecuteWithDeadlockRetryInternal<TResult>(
	Func<TResult> executionFunc,
	int retryCount
)

Parameters

executionFunc
Type: SystemFuncTResult
Function to be executed.
retryCount
Type: SystemInt32
Limit of retry executions. If the limit is reached, the exception resulting from the last execution is re-thrown.

Type Parameters

TResult
Return type of the executionFunc.

Return Value

Type: TResult
Return the result of executionFunc if its execution succeeds before retryCount limit is reached.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when executionFunc is null.
See Also