Class TransientRetryPolicy
- Namespace
- LinqToDB.Data.RetryPolicy
- Assembly
- linq2db.dll
Retry policy handles exceptions with DbException.IsTransient == true (requires provider support and .NET 6 or greater).
public sealed class TransientRetryPolicy : RetryPolicyBase, IRetryPolicy
- Inheritance
-
objectTransientRetryPolicy
- Implements
- Inherited Members
- Extension Methods
Constructors
TransientRetryPolicy()
Creates a new instance of TransientRetryPolicy.
public TransientRetryPolicy()
TransientRetryPolicy(int)
Creates a new instance of TransientRetryPolicy.
public TransientRetryPolicy(int maxRetryCount)
Parameters
maxRetryCountintThe maximum number of retry attempts.
TransientRetryPolicy(int, TimeSpan, double, double, TimeSpan)
Creates a new instance of TransientRetryPolicy.
public TransientRetryPolicy(int maxRetryCount, TimeSpan maxRetryDelay, double randomFactor, double exponentialBase, TimeSpan coefficient)
Parameters
maxRetryCountintThe maximum number of retry attempts.
maxRetryDelayTimeSpanThe maximum delay in milliseconds between retries.
randomFactordoubleThe maximum random factor.
exponentialBasedoubleThe base for the exponential function used to compute the delay between retries.
coefficientTimeSpanThe coefficient for the exponential function used to compute the delay between retries.
Methods
ShouldRetryOn(Exception)
Determines whether the specified exception represents a transient failure that can be compensated by a retry.
protected override bool ShouldRetryOn(Exception exception)
Parameters
exceptionExceptionThe exception object to be verified.