DbExecutionStrategy Class

 

Provides the base implementation of the retry mechanism for unreliable operations and transient conditions that uses exponentially increasing delays between retries.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

System.Object
  System.Data.Entity.Infrastructure.DbExecutionStrategy
    System.Data.Entity.SqlServer.SqlAzureExecutionStrategy

public abstract class DbExecutionStrategy : IDbExecutionStrategy

NameDescription
System_CAPS_protmethodDbExecutionStrategy()

Initializes a new instance of the DbExecutionStrategy class.

System_CAPS_protmethodDbExecutionStrategy(Int32, TimeSpan)

Initializes a new instance of the DbExecutionStrategy class with the specified limits for number of retries and the delay between retries.

NameDescription
System_CAPS_pubpropertyRetriesOnFailure

Gets a value that indicates whether DbExecutionStrategy might retry the execution after a failure.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExecute(Action)

Repetitively executes the specified operation while it satisfies the current retry policy.

System_CAPS_pubmethodExecute<TResult>(Func<TResult>)

Repetitively executes the specified operation while it satisfies the current retry policy.

System_CAPS_pubmethodExecuteAsync(Func<Task>, CancellationToken)

Repetitively executes the specified asynchronous operation while it satisfies the current retry policy.

System_CAPS_pubmethodExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken)

Repeatedly executes the specified asynchronous operation while it satisfies the current retry policy.

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_protmethodGetNextDelay(Exception)

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

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodShouldRetryOn(Exception)

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

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticUnwrapAndHandleException<T>(Exception, Func<Exception, T>)

Recursively gets InnerException from exception as long as it is an EntityException, DbUpdateException or UpdateException and passes it to exceptionHandler.

A new instance will be created each time an operation is executed. The following formula is used to calculate the delay after retryCount number of attempts: min(random(1, 1.1) * (2 ^ retryCount - 1), maxDelay) The retryCount starts at 0. The random factor distributes uniformly the retry attempts from multiple simultaneous operations failing simultaneously.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.