2017-04-18 07:52:04 +08:00
|
|
|
## ADO.NET now attempts to automatically reconnect broken SQL connections
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Scope
|
|
|
|
Edge
|
|
|
|
|
|
|
|
### Version Introduced
|
|
|
|
4.5.1
|
|
|
|
|
|
|
|
### Source Analyzer Status
|
|
|
|
Planned
|
|
|
|
|
|
|
|
### Change Description
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
Beginning in the .NET Framework 4.5.1, the .NET Framework will attempt to
|
|
|
|
automatically reconnect broken SQL connections. Although this will typically
|
|
|
|
make apps more reliable, there are edge cases in which an app needs to know that
|
|
|
|
the connection was lost so that it can take some action upon reconnection.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
- [ ] Quirked
|
|
|
|
- [ ] Build-time break
|
|
|
|
|
|
|
|
### Recommended Action
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
If this feature is undesirable due to compatibility concerns, it can be disabled
|
|
|
|
by setting the
|
|
|
|
<xref:System.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryCount?displayProperty=name>
|
|
|
|
property of a connection string (or
|
|
|
|
<xref:System.Data.SqlClient.SqlConnectionStringBuilder?displayProperty=name>) to
|
|
|
|
0.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Affected APIs
|
|
|
|
* `M:System.Data.IDbConnection.set_ConnectionString(System.String)`
|
|
|
|
* `M:System.Data.SqlClient.SqlConnection.set_ConnectionString(System.String)`
|
|
|
|
* `M:System.Configuration.ConnectionStringSettings.set_ConnectionString(System.String)`
|
|
|
|
* `M:System.Data.Common.DbConnection.set_ConnectionString(System.String)`
|
|
|
|
* `M:System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(System.String)`
|
|
|
|
* `M:System.Data.SqlClient.SqlConnectionStringBuilder.#ctor`
|
|
|
|
* `M:System.Data.SqlClient.SqlConnectionStringBuilder.#ctor(System.String)`
|
|
|
|
* `M:System.Data.Common.DbConnectionStringBuilder.#ctor`
|
|
|
|
* `M:System.Data.Common.DbConnectionStringBuilder.#ctor(System.Boolean)`
|
|
|
|
|
|
|
|
### Categories
|
|
|
|
ADO.NET
|
|
|
|
Data
|
|
|
|
|
|
|
|
[More information](http://blogs.msdn.com/b/dotnet/archive/2013/10/17/net-framework-4-5-1-rtm-gt-start-coding.aspx)
|
|
|
|
|
|
|
|
<!--
|
|
|
|
### Notes
|
|
|
|
It would be very difficult to know if code depended on not auto-reconnecting and ADO.NET connection.
|
|
|
|
Source analyzer status: Planned - No tracking work item yet
|
|
|
|
Single-diagnostic compilation action analyzer
|
|
|
|
-->
|
|
|
|
|
2017-04-18 07:52:04 +08:00
|
|
|
<!-- breaking change id: 119 -->
|