DbExecutionStrategy Class
Provides the base implementation of the retry mechanism for unreliable operations and transient conditions that uses exponentially increasing delays between retries.
Assembly: EntityFramework (in EntityFramework.dll)
System.Data.Entity.Infrastructure.DbExecutionStrategy
System.Data.Entity.SqlServer.SqlAzureExecutionStrategy
Name | Description | |
---|---|---|
![]() | DbExecutionStrategy() | Initializes a new instance of the DbExecutionStrategy class. |
![]() | DbExecutionStrategy(Int32, TimeSpan) | Initializes a new instance of the DbExecutionStrategy class with the specified limits for number of retries and the delay between retries. |
Name | Description | |
---|---|---|
![]() | RetriesOnFailure | Gets a value that indicates whether DbExecutionStrategy might retry the execution after a failure. |
Name | Description | |
---|---|---|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Execute(Action) | Repetitively executes the specified operation while it satisfies the current retry policy. |
![]() | Execute<TResult>(Func<TResult>) | Repetitively executes the specified operation while it satisfies the current retry policy. |
![]() | ExecuteAsync(Func<Task>, CancellationToken) | Repetitively executes the specified asynchronous operation while it satisfies the current retry policy. |
![]() | ExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken) | Repeatedly executes the specified asynchronous operation while it satisfies the current retry policy. |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetNextDelay(Exception) | Determines whether the operation should be retried and the delay before the next attempt. |
![]() | GetType() | (Inherited from Object.) |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ShouldRetryOn(Exception) | Determines whether the specified exception represents a transient failure that can be compensated by a retry. |
![]() | ToString() | (Inherited from Object.) |
![]() ![]() | UnwrapAndHandleException<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.