Share via


AzureSqlDbContextOptionsBuilder.EnableRetryOnFailure Method

Definition

Overloads

EnableRetryOnFailure()

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(ICollection<Int32>)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(Int32)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(Int32, TimeSpan, IEnumerable<Int32>)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure()

Source:
AzureSqlDbContextOptionsBuilder.cs

Configures the context to use the default retrying IExecutionStrategy.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder EnableRetryOnFailure ();
abstract member EnableRetryOnFailure : unit -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
override this.EnableRetryOnFailure : unit -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
Public Overridable Function EnableRetryOnFailure () As AzureSqlDbContextOptionsBuilder

Returns

Remarks

This strategy is specifically tailored to Azure SQL. It is pre-configured with error numbers for transient errors that can be retried.

Default values of 6 for the maximum retry count and 30 seconds for the maximum default delay are used.

See Connection resiliency and database retries for more information and examples.

Applies to

EnableRetryOnFailure(ICollection<Int32>)

Source:
AzureSqlDbContextOptionsBuilder.cs

Configures the context to use the default retrying IExecutionStrategy.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder EnableRetryOnFailure (System.Collections.Generic.ICollection<int> errorNumbersToAdd);
abstract member EnableRetryOnFailure : System.Collections.Generic.ICollection<int> -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
override this.EnableRetryOnFailure : System.Collections.Generic.ICollection<int> -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
Public Overridable Function EnableRetryOnFailure (errorNumbersToAdd As ICollection(Of Integer)) As AzureSqlDbContextOptionsBuilder

Parameters

errorNumbersToAdd
ICollection<Int32>

Additional SQL error numbers that should be considered transient.

Returns

Remarks

This strategy is specifically tailored to Azure SQL. It is pre-configured with error numbers for transient errors that can be retried.

Default values of 6 for the maximum retry count and 30 seconds for the maximum default delay are used.

See Connection resiliency and database retries for more information and examples.

Applies to

EnableRetryOnFailure(Int32)

Source:
AzureSqlDbContextOptionsBuilder.cs

Configures the context to use the default retrying IExecutionStrategy.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder EnableRetryOnFailure (int maxRetryCount);
abstract member EnableRetryOnFailure : int -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
override this.EnableRetryOnFailure : int -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
Public Overridable Function EnableRetryOnFailure (maxRetryCount As Integer) As AzureSqlDbContextOptionsBuilder

Parameters

maxRetryCount
Int32

Returns

Remarks

This strategy is specifically tailored to Azure SQL. It is pre-configured with error numbers for transient errors that can be retried.

A default value 30 seconds for the maximum default delay is used.

See Connection resiliency and database retries for more information and examples.

Applies to

EnableRetryOnFailure(Int32, TimeSpan, IEnumerable<Int32>)

Source:
AzureSqlDbContextOptionsBuilder.cs

Configures the context to use the default retrying IExecutionStrategy.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder EnableRetryOnFailure (int maxRetryCount, TimeSpan maxRetryDelay, System.Collections.Generic.IEnumerable<int>? errorNumbersToAdd);
abstract member EnableRetryOnFailure : int * TimeSpan * seq<int> -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
override this.EnableRetryOnFailure : int * TimeSpan * seq<int> -> Microsoft.EntityFrameworkCore.Infrastructure.AzureSqlDbContextOptionsBuilder
Public Overridable Function EnableRetryOnFailure (maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As IEnumerable(Of Integer)) As AzureSqlDbContextOptionsBuilder

Parameters

maxRetryCount
Int32

The maximum number of retry attempts.

maxRetryDelay
TimeSpan

The maximum delay between retries.

errorNumbersToAdd
IEnumerable<Int32>

Additional SQL error numbers that should be considered transient.

Returns

Remarks

This strategy is specifically tailored to Azure SQL. It is pre-configured with error numbers for transient errors that can be retried, but additional error numbers can also be supplied.

See Connection resiliency and database retries for more information and examples.

Applies to