Table of Contents

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
object
TransientRetryPolicy
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

maxRetryCount int

The 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

maxRetryCount int

The maximum number of retry attempts.

maxRetryDelay TimeSpan

The maximum delay in milliseconds between retries.

randomFactor double

The maximum random factor.

exponentialBase double

The base for the exponential function used to compute the delay between retries.

coefficient TimeSpan

The 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

exception Exception

The exception object to be verified.

Returns

bool

true if the specified exception is considered as transient, otherwise false.