Class SqlTransientErrorsRetryPolicy
A retry policy implementing exponential backoff designed for SQL Server
Inheritance
System.Object
SqlTransientErrorsRetryPolicy
Assembly: EPiServer.Data.dll
Version: 12.0.3
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
Declaration
public int Retries { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
RetryDelay
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 Parameters
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
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