November Happy Hour will be moved to Thursday December 5th.

Class SqlTransientErrorsRetryPolicy

A retry policy implementing exponential backoff designed for SQL Server

Inheritance
System.Object
SqlTransientErrorsRetryPolicy
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Data.Providers
Assembly: EPiServer.Data.dll
Version: 9.12.2
Syntax
public class SqlTransientErrorsRetryPolicy : RetryPolicy

Constructors

SqlTransientErrorsRetryPolicy(IEnumerable<Int32>, Int32, TimeSpan)

Declaration
public SqlTransientErrorsRetryPolicy(IEnumerable<int> detectErrors, int retries, TimeSpan retryDelay)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Int32> detectErrors
System.Int32 retries
System.TimeSpan retryDelay

Properties

Retries

Number of retries

Declaration
public int Retries { get; set; }
Property Value
Type Description
System.Int32

RetryDelay

Retry delay

Declaration
public TimeSpan RetryDelay { get; set; }
Property Value
Type Description
System.TimeSpan

Methods

Execute<TResult>(Func<TResult>)

Declaration
public override TResult Execute<TResult>(Func<TResult> method)
Parameters
Type Name Description
System.Func<TResult> method
Returns
Type Description
TResult
Type Parameters
Name Description
TResult
Overrides
EPiServer.Data.Providers.RetryPolicy.Execute<TResult>(System.Func<TResult>)

ExecuteAsync<TResult>(Func<Task<TResult>>)

Declaration
public override Task<TResult> ExecuteAsync<TResult>(Func<Task<TResult>> method)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task<TResult>> method
Returns
Type Description
System.Threading.Tasks.Task<TResult>
Type Parameters
Name Description
TResult
Overrides
EPiServer.Data.Providers.RetryPolicy.ExecuteAsync<TResult>(System.Func<System.Threading.Tasks.Task<TResult>>)

GetSqlErrors(DbException)

Get SQL error codes from an System.Data.Common.DbException

Declaration
protected virtual IEnumerable<int> GetSqlErrors(DbException ex)
Parameters
Type Name Description
System.Data.Common.DbException ex
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Int32>

IsTransientException(DbException)

Determines whether the specified exception represents a transient failure that can be compensated by a retry.

Declaration
protected virtual bool IsTransientException(DbException ex)
Parameters
Type Name Description
System.Data.Common.DbException ex

The exception object to be verified.

Returns
Type Description
System.Boolean

True if the specified exception is considered as transient, otherwise false.

Extension Methods