Skip to content

Commit 4b5f38f

Browse files
authored
Update connection settings and clarify Command Timeout
Removed the Command Timeout description from the settings list and updated related text for clarity.
1 parent 79c9d3e commit 4b5f38f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

azure-sql/database/troubleshoot-common-connectivity-issues.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ When you build the [connection string](/dotnet/api/system.data.sqlclient.sqlconn
138138
- **ConnectRetryCount**:  Default is **1**. The range is **0** through **255**.
139139
- **ConnectRetryInterval**:  Default is **10** seconds. The range is **1** through **60**.
140140
- **Connection Timeout**:  Default is **15** seconds. The range is **0** through **2147483647**.
141-
- **Command Timeout**:  Default is **30** seconds. The range is **0** through **2147483647**.
142141

143142
The connection retry settings (**ConnectRetryCount** and **ConnectRetryInterval**) apply to connection resiliency. Connection resiliency includes the following distinct types:
144143

@@ -186,7 +185,7 @@ For example, if the count is 3 and the interval is 10 seconds, a timeout of only
186185

187186
4:10:20 - Retry 3
188187

189-
This isn't the initial connection. Therefore, **Connection Timeout** doesn't apply. However, because the connection recovery occurs during command execution, the **Command Timeout** setting does apply. The **Command Timeout** default is 30 seconds. Although, connection recovery is fast in typical circumstances, an intermittent outage, could cause the recovery to take some of the command execution time.
188+
This isn't the initial connection. Therefore, **Connection Timeout** doesn't apply. However, because the connection recovery occurs during command execution, the **Command Timeout** property of the [SqlCommand](/dotnet/api/system.data.sqlclient.sqlcommand.commandtimeout) executing the statement does apply. The **Command Timeout** default is 30 seconds. Although, connection recovery is fast in typical circumstances, an intermittent outage, could cause the recovery to take some of the command execution time.
190189

191190
For this scenario, if you want to take full advantage of idle connection recovery retries, your chosen values should satisfy the following condition:
192191
`Command Timeout > (ConnectRetryCount - 1) * ConnectionRetryInterval`
@@ -205,7 +204,7 @@ Also, consider that the command itself requires time to execute after the connec
205204
The **ConnectRetryCount** and **ConnectRetryInterval** parameters let your **SqlConnection** object retry the connect operation without telling or bothering your program, such as returning control to your program. The retries can occur in the following situations:
206205

207206
- SqlConnection.Open method call
208-
- SqlConnection.Execute method call
207+
- SqlCommand.Execute method call
209208

210209
There is a subtlety. If a transient error occurs while your *query* is being executed, your **SqlConnection** object doesn't retry the connect operation. It certainly doesn't retry your query. However, **SqlConnection** very quickly checks the connection before sending your query for execution. If the quick check detects a connection problem, **SqlConnection** retries the connect operation. If the retry succeeds, your query is sent for execution.
211210

0 commit comments

Comments
 (0)