SqlAzureExecutionStrategy SqlAzureExecutionStrategy Class

Definition

public class SqlAzureExecutionStrategy : ExecutionStrategy, IExecutionStrategy
Public Class SqlAzureExecutionStrategy
    Inherits ExecutionStrategy
    Implements IExecutionStrategy
Inheritance
System.ObjectSystem.Object
SqlAzureExecutionStrategySqlAzureExecutionStrategy
Implements

Constructors

SqlAzureExecutionStrategy() SqlAzureExecutionStrategy()

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy()
Protected Sub New

Remarks

The default retry limit is 5, which means that the total amount of time spent before failing is 26 seconds plus the random factor.

SqlAzureExecutionStrategy(DbContext) SqlAzureExecutionStrategy(DbContext)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context)
Public Sub New(context As DbContext)
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

Remarks

The default retry limit is 5, which means that the total amount of time spent before failing is 26 seconds plus the random factor.

SqlAzureExecutionStrategy(DbContext, Int32) SqlAzureExecutionStrategy(DbContext, Int32)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context, int maxRetryCount)
Public Sub New(context As DbContext, maxRetryCount As Integer)
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(DbContext, Int32, TimeSpan, ICollection) SqlAzureExecutionStrategy(DbContext, Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context, int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)
Public Sub New(context As DbContext, maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

SqlAzureExecutionStrategy(ExecutionStrategyContext) SqlAzureExecutionStrategy(ExecutionStrategyContext)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context)
Public Sub New(context As ExecutionStrategyContext)
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32) SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context, int maxRetryCount)
Public Sub New(context As ExecutionStrategyContext, maxRetryCount As Integer)
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32, TimeSpan, ICollection) SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context, int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)
Public Sub New(context As ExecutionStrategyContext, maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

SqlAzureExecutionStrategy(Int32) SqlAzureExecutionStrategy(Int32)

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy(int maxRetryCount)
Protected Sub New(maxRetryCount As Integer)
Parameters
maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(Int32, TimeSpan, ICollection) SqlAzureExecutionStrategy(Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy(int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)
Protected Sub New(maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

Execute(Func, TState) Execute(Of TState, TResult)(Func(Of TState, TResult), TState)

Inherited from ExecutionStrategy

ExecuteAsync(Func>, TState, CancellationToken) ExecuteAsync(Of TState, TResult)(Func(Of TState, CancellationToken, Task(Of TResult)), TState, CancellationToken)

Inherited from ExecutionStrategy

GetHashCode() GetHashCode()

Inherited from System.Object

GetNextDelay(Exception) GetNextDelay(Exception)

Determines whether the operation should be retried and the delay before the next attempt.

(Inherited from ExecutionStrategy)

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

OnFirstExecution() OnFirstExecution()

Method called before the first operation execution

(Inherited from ExecutionStrategy)

OnRetry() OnRetry()

Method called before retrying the operation execution

(Inherited from ExecutionStrategy)

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ShouldRetryOn(Exception) ShouldRetryOn(Exception)

protected override bool ShouldRetryOn(Exception exception)
Protected Overrides Function ShouldRetryOn(exception As Exception) As Boolean
Parameters
exception
System.Exception System.Exception
Returns
System.Boolean System.Boolean
Overrides

ToString() ToString()

Inherited from System.Object

UnwrapAndHandleException(Exception, Func) UnwrapAndHandleException(Of T)(Exception, Func(Of Exception, T))

Inherited from ExecutionStrategy

Fields

DefaultMaxDelay DefaultMaxDelay

The default maximum time delay between retries, must be nonnegative.

(Inherited from ExecutionStrategy)

DefaultMaxRetryCount DefaultMaxRetryCount

The default number of retry attempts.

(Inherited from ExecutionStrategy)

Properties

Context Context

The context on which the operations will be invoked.

(Inherited from ExecutionStrategy)

ExceptionsEncountered ExceptionsEncountered

The list of exceptions that caused the operation to be retried so far.

(Inherited from ExecutionStrategy)

Logger Logger

The logger for this ExecutionStrategy.

(Inherited from ExecutionStrategy)

MaxRetryCount MaxRetryCount

The maximum number of retry attempts.

(Inherited from ExecutionStrategy)

MaxRetryDelay MaxRetryDelay

The maximum delay in milliseconds between retries.

(Inherited from ExecutionStrategy)

Random Random

A pseudo-random number generater that can be used to vary the delay between retries.

(Inherited from ExecutionStrategy)

RetriesOnFailure RetriesOnFailure

Indicates whether this IExecutionStrategy might retry the execution after a failure.

(Inherited from ExecutionStrategy)

Suspended Suspended

Indicates whether the strategy is suspended. The strategy is typically suspending while executing to avoid recursive execution from nested operations.

(Inherited from ExecutionStrategy)