Skip to content

Commit ce65232

Browse files
authored
Merge pull request #20072 from MicrosoftDocs/master
8/25 PM Publish
2 parents 429ad11 + 37dc8c3 commit ce65232

7 files changed

Lines changed: 70 additions & 48 deletions

docs/connect/ado-net/configurable-retry-logic-config-file-sqlclient.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.reviewer: v-deshtehari
1616

1717
[!INCLUDE[Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
1818

19-
The default retry method when the safety switch is enabled is the `Microsoft.Data.SqlClient.SqlConnection.SqlConfigurableRetryFactory.CreateNoneRetryProvider` for both <xref:Microsoft.Data.SqlClient.SqlConnection> and <xref:Microsoft.Data.SqlClient.SqlCommand>. You can specify a different retry method by using a configuration file.
19+
The default retry method when the safety switch is enabled is the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider%2A?displayProperty=nameWithType> for both <xref:Microsoft.Data.SqlClient.SqlConnection> and <xref:Microsoft.Data.SqlClient.SqlCommand>. You can specify a different retry method by using a configuration file.
2020

2121
## Configuration sections
2222

@@ -36,7 +36,7 @@ Default retry logic options for an application can be changed by adding the foll
3636
type="Microsoft.Data.SqlClient.SqlConfigurableRetryCommandSection, Microsoft.Data.SqlClient"/>
3737
```
3838

39-
- `AppContextSwitchOverrides`: .NET Framework supports AppContext switches via an `AppContextSwitchOverrides` section, which doesn't need to be defined explicitly. To turn on a switch in .NET Core, you must specify this section.
39+
- `AppContextSwitchOverrides`: .NET Framework supports AppContext switches via an [AppContextSwitchOverrides](/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element) section, which doesn't need to be defined explicitly. To turn on a switch in **.NET Core**, you must specify this section.
4040

4141
```csharp
4242
<section name="AppContextSwitchOverrides"
@@ -66,19 +66,19 @@ You can enable the safety switch through a configuration file. To learn how to e
6666

6767
### Connection section
6868

69-
The following attributes can be used to specify the default retry logic for all `Microsoft.Data.SqlClient.SqlConnection` instances in an application:
69+
The following attributes can be used to specify the default retry logic for all <xref:Microsoft.Data.SqlClient.SqlConnection> instances in an application:
7070

7171
- **numberOfTries**: sets the number of times to try.
7272

73-
- **deltaTime**: sets the gap time interval as a `System.TimeSpan` object.
73+
- **deltaTime**: sets the gap time interval as a <xref:System.TimeSpan> object.
7474

75-
- **minTime**: sets the allowed minimum gap time interval as a `System.TimeSpan` object.
75+
- **minTime**: sets the allowed minimum gap time interval as a <xref:System.TimeSpan> object.
7676

77-
- **maxTime**: sets the allowed maximum gap time interval as a `System.TimeSpan` object.
77+
- **maxTime**: sets the allowed maximum gap time interval as a <xref:System.TimeSpan> object.
7878

7979
- **transientErrors**: sets the list of transient error numbers on which to retry.
8080

81-
- **retryMethod**: specifies a retry method creator that receives the retry configuration via a `Microsoft.Data.SqlClient.SqlRetryLogicOption` parameter and returns a `Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider` object.
81+
- **retryMethod**: specifies a retry method creator that receives the retry configuration via a <xref:Microsoft.Data.SqlClient.SqlRetryLogicOption> parameter and returns a <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> object.
8282

8383
- **retryLogicType**: sets a custom retry logic provider, which contains the retry method creators that provide the `retryMethod`. These methods should meet the criteria for `retryMethod`. The fully qualified type name of the provider should be used. For more information, see [Specifying fully qualified type names](/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names).
8484

@@ -89,35 +89,35 @@ The following attributes can be used to specify the default retry logic for all
8989

9090
The following attribute can also be set for all <xref:Microsoft.Data.SqlClient.SqlCommand> instances in an application:
9191

92-
- **authorizedSqlCondition**: Sets a pre-retry regular expression for <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText> to filter specific SQL statements.
92+
- **authorizedSqlCondition**: Sets a pre-retry regular expression for <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A?displayProperty=nameWithType> to filter specific SQL statements.
9393

9494
> [!NOTE]
9595
> The regular expression is case sensitive.
9696

9797
### Examples
9898

99-
- Attempts to establish a connection up to three times with an approximate 1-second delay between tries by using the `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider` method and the default transient error list:
99+
- Attempts to establish a connection up to three times with an approximate 1-second delay between tries by using the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider%2A?displayProperty=nameWithType> method and the default transient error list:
100100

101101
```csharp
102102
<SqlConfigurableRetryLogicConnection retryMethod ="CreateFixedRetryProvider"
103103
numberOfTries ="3" deltaTime ="00:00:01"/>
104104
```
105105

106-
- Attempts to establish a connection up to five times with up to a 45-second delay between tries by using the `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider` method and the default transient error list:
106+
- Attempts to establish a connection up to five times with up to a 45-second delay between tries by using the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider%2A?displayProperty=nameWithType> method and the default transient error list:
107107

108108
```csharp
109109
<SqlConfigurableRetryLogicConnection retryMethod ="CreateExponentialRetryProvider"
110110
numberOfTries ="5" deltaTime ="00:00:03" maxTime ="00:00:45"/>
111111
```
112112

113-
- Attempts to execute a command up to four times with a delay between 2 and 30 seconds by using the `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider` method and the default transient error list:
113+
- Attempts to execute a command up to four times with a delay between 2 and 30 seconds by using the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider%2A?displayProperty=nameWithType> method and the default transient error list:
114114

115115
```csharp
116116
<SqlConfigurableRetryLogicCommand retryMethod ="CreateIncrementalRetryProvider"
117117
numberOfTries ="4" deltaTime ="00:00:02" maxTime ="00:00:30"/>
118118
```
119119

120-
- Attempts to execute a command up to eight times with a delay from one second to one minute. It's limited to commands with `CommandText` containing the word `SELECT` and exception numbers 102 or 997. It uses the built-in `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider` method:
120+
- Attempts to execute a command up to eight times with a delay from one second to one minute. It's limited to commands with `CommandText` containing the word `SELECT` and exception numbers 102 or 997. It uses the built-in <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider%2A?displayProperty=nameWithType> method:
121121

122122
```csharp
123123
<SqlConfigurableRetryLogicCommand retryMethod ="CreateIncrementalRetryProvider"
@@ -151,7 +151,7 @@ The following attribute can also be set for all <xref:Microsoft.Data.SqlClient.S
151151
> Retry logic providers will be cached at the first use on a connection or command for future use during an application's lifetime.
152152

153153
> [!NOTE]
154-
> Any errors when reading an application configuration file for retry logic settings won't cause errors in the application. The default `Microsoft.Data.SqlClient.SqlConnection.SqlConfigurableRetryFactory.CreateNoneRetryProvider` will be used instead.
154+
> Any errors when reading an application configuration file for retry logic settings won't cause errors in the application. The default <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider%2A?displayProperty=nameWithType> will be used instead.
155155
>
156156
> You can use event source tracing to verify or troubleshoot issues with configuring retry logic. For more information, see [Enable event tracing in SqlClient](enable-eventsource-tracing.md).
157157

docs/connect/ado-net/configurable-retry-logic-core-apis-sqlclient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ If the built-in retry logic providers don't cover your needs, you can create you
2020

2121
The built-in providers are designed around three interfaces that can be used to implement custom providers. Custom retry providers can then be used in the same way as internal retry providers on a <xref:Microsoft.Data.SqlClient.SqlConnection> or <xref:Microsoft.Data.SqlClient.SqlCommand>:
2222

23-
1. `Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator`: Generates a sequence of time intervals.
24-
2. `Microsoft.Data.SqlClient.SqlRetryLogicBase`: Retrieves the next time interval for a given enumerator, if the number of retries has not been exceeded and a transient condition is met.
25-
3. `Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider`: Applies retry logic to connection and command operations.
23+
1. <xref:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator>: Generates a sequence of time intervals.
24+
2. <xref:Microsoft.Data.SqlClient.SqlRetryLogicBase>: Retrieves the next time interval for a given enumerator, if the number of retries has not been exceeded and a transient condition is met.
25+
3. <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider>: Applies retry logic to connection and command operations.
2626

2727
> [!CAUTION]
2828
> By implementing a custom retry logic provider, you're in charge of all aspects, including concurrency, performance, and exception management.
@@ -63,7 +63,7 @@ The implementation in this sample is as simple as possible to demonstrate step-b
6363

6464
[!code-csharp[SqlConfigurableRetryLogic_StepByStep_CustomProvider#2](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_StepByStep_CustomProvider.cs#2)]
6565

66-
- Assign the retry provider to the `Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider` or `Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider`:
66+
- Assign the retry provider to the <xref:Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider%2A?displayProperty=nameWithType> or <xref:Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider%2A?displayProperty=nameWithType>:
6767

6868
[!code-csharp[SqlConfigurableRetryLogic_StepByStep_CustomProvider#3](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_StepByStep_CustomProvider.cs#3)]
6969

docs/connect/ado-net/configurable-retry-logic-sqlclient-introduction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Configurable retry logic lets developers and administrators manage application b
2323
This feature consists of three main components:
2424

2525
1. **Core APIs**: Developers can use these interfaces to implement their own retry logic on <xref:Microsoft.Data.SqlClient.SqlConnection> and <xref:Microsoft.Data.SqlClient.SqlCommand> objects. For more information, see [Configurable retry logic core APIs in SqlClient](configurable-retry-logic-core-apis-sqlclient.md).
26-
2. **Pre-defined configurable retry logic**: Built-in retry logic methods using the core APIs are accessible from the `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory` class. For more information, see [Internal retry logic providers in SqlClient](internal-retry-logic-providers-sqlclient.md).
26+
2. **Pre-defined configurable retry logic**: Built-in retry logic methods using the core APIs are accessible from the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory> class. For more information, see [Internal retry logic providers in SqlClient](internal-retry-logic-providers-sqlclient.md).
2727
3. **Configuration file schema**: To specify the default retry logic for <xref:Microsoft.Data.SqlClient.SqlConnection> and <xref:Microsoft.Data.SqlClient.SqlCommand> in an application. For more information, see [Configurable retry logic configuration file with SqlClient](configurable-retry-logic-config-file-sqlclient.md).
2828

2929
## Quick start
@@ -32,22 +32,22 @@ To use this feature, follow these four steps:
3232

3333
1. Enable the safety switch in the preview version. For information on how to enable the AppContext safety switch, see [Enable configurable retry logic](appcontext-switches.md#enable-configurable-retry-logic).
3434

35-
2. Define the retry logic options using `Microsoft.Data.SqlClient.SqlRetryLogicOption`.
35+
2. Define the retry logic options using <xref:Microsoft.Data.SqlClient.SqlRetryLogicOption>.
3636
In this sample, some of the retry parameters are set and the rest of them will use the default values.
3737

3838
[!code-csharp[SqlConfigurableRetryLogic_StepByStep_OpenConnection#1](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_StepByStep_OpenConnection.cs#1)]
3939

40-
3. Create a retry logic provider using your `Microsoft.Data.SqlClient.SqlRetryLogicOption` object.
40+
3. Create a retry logic provider using your <xref:Microsoft.Data.SqlClient.SqlRetryLogicOption> object.
4141

4242
[!code-csharp[SqlConfigurableRetryLogic_StepByStep_OpenConnection#2](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_StepByStep_OpenConnection.cs#2)]
4343

44-
4. Assign the `Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider` instance to the `Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider` or `Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider`.
45-
In this sample, the connection open command will retry if it hits one of the transient errors in the `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory` internal list for a maximum of five times.
44+
4. Assign the <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> instance to the <xref:Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider%2A?displayProperty=nameWithType> or <xref:Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider%2A?displayProperty=nameWithType>.
45+
In this sample, the connection open command will retry if it hits one of the transient errors in the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory> internal list for a maximum of five times.
4646

4747
[!code-csharp[SqlConfigurableRetryLogic_StepByStep_OpenConnection#3](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_StepByStep_OpenConnection.cs#3)]
4848

4949
> [!NOTE]
50-
> These steps are the same for a command execution, except you would instead assign the retry provider to the `Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider` property before executing the command.
50+
> These steps are the same for a command execution, except you would instead assign the retry provider to the <xref:Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider%2A?displayProperty=nameWithType> property before executing the command.
5151
5252
## See also
5353

docs/connect/ado-net/internal-retry-logic-providers-sqlclient.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,25 @@ ms.reviewer: v-deshtehari
1616

1717
[!INCLUDE[Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
1818

19-
Built-in, internal retry providers have been implemented for the most common retry patterns. You can use the retry providers by using the following `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory` static methods:
19+
Built-in, internal retry providers have been implemented for the most common retry patterns. You can use the retry providers by using the following <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory?displayProperty=fullName> static methods:
2020

21-
- `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider`
22-
- `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider`
23-
- `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider`
24-
- `Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider`
21+
- <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider%2A?displayProperty=nameWithType>
22+
- <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider%2A?displayProperty=nameWithType>
23+
- <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider%2A?displayProperty=nameWithType>
24+
- <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider%2A?displayProperty=nameWithType>
2525

2626
> [!NOTE]
2727
> All of the internal retry providers slightly randomize interval gap times before each retry. This randomization avoids hitting the database at the same time when multiple clients are trying to connect or execute a command with the same configuration.
2828
2929
> [!WARNING]
3030
> Internal retry providers don't support retrying on a command that executes in an open transaction. That operation will execute without retry logic. You can override this behavior by using custom retry logic. For more information, see [Configurable retry logic core APIs in SqlClient](configurable-retry-logic-core-apis-sqlclient.md).
3131
32-
<!-- These links won't be live until after the feature is released in a GA version.
3332
## Example
3433

3534
You can find samples for `connection` and `command` retry logic at the following links:
3635

37-
- [Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider#example](/dotnet/api/microsoft.data.sqlclient.sqlconnection.RetryLogicProvider?view=sqlclient-dotnet-core-2.1&preserve-view=true#examples)
38-
- [Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider#example](/dotnet/api/microsoft.data.sqlclient.sqlcommand.RetryLogicProvider?view=sqlclient-dotnet-core-2.1&preserve-view=true#examples)
39-
-->
36+
- <xref:Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider%2A?displayProperty=nameWithType>
37+
- <xref:Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider%2A?displayProperty=nameWithType>
4038

4139
## See also
4240

0 commit comments

Comments
 (0)