Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server 2014 (12.x) and later
Azure SQL Database
Starting with Microsoft OLE DB Driver for SQL Server version 18.6.0, connection resiliency allows the driver to automatically restore broken idle connections.
The following diagram explains how idle connection resiliency works in the OLE DB Driver:
Keyword | Property | Values | Default | Description |
---|---|---|---|---|
ConnectRetryCount | SSPROP_INIT_CONNECT_RETRY_COUNT | Integer Value between 0 and 255 (inclusive) | 1 | Controls the maximum number of reconnection attempts if the connection has been broken. By default, a single attempt is made to re-establish a connection when broken. A value of 0 means that no reconnection will be attempted. |
ConnectRetryInterval | SSPROP_INIT_CONNECT_RETRY_INTERVAL | Integer between 1 and 60 (inclusive) | 10 | The time in seconds, between each connection retry attempt. This keyword is ignored if ConnectRetryCount is equal to 0. |
The following pages provide more information about setting these properties:
If an application establishes a connection with DBPROP_INIT_PROMPT and later tries to execute a statement over a broken connection, the OLE DB driver won't display the dialog box again.
When obtaining the connection status via the property DBPROP_CONNECTIONSTATUS:
Note
If the command timeout (DBPROP_COMMANDTIMEOUT in DBPROPSET_ROWSET) has been set to a non-zero value and the connection recovery takes longer than the command timeout, the connection will not be recovered.
If using asynchronous execution and the connection needs to be recovered, the connection recovery will happen synchronously before the asynchronous call is executed. For more information about asynchronous execution, see Performing Asynchronous Operations.
If connection recovery fails, one of the following errors can occur:
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today