Skip to content

Exception not immediately thrown after connect failure when connectRetryCount=0 #2232

@bukkfrig

Description

@bukkfrig

Driver version

Starting in 9.5.0, through current version: 12.4.1.

SQL Server version

Microsoft SQL Server 2019

Client Operating System

Windows Server 2016 Standard

JAVA/JVM version

17

Problem description

Prior to driver version 9.3.0, when we would have a connection failure (for testing, we use "Take offline" at the database), we would get a SQLServerException immediately on trying to connect, and this was the desired behaviour for our application.

After the changes in version 9.3.0 ("added Open Connection Retry"), instead we have to wait for the duration of the "loginTimeout" before getting the SQLServerException. In versions 9.3.0 through 9.4.1 we could remedy this by setting connectRetryCount=0, and again get the desired immediate SQLServerException.

However, after the changes in version 9.5.0 ("Idle Connection Resiliency Feature"), setting the connectRetryCount=0 no longer triggers an immediate exception when the database is offline.

Expected behavior

With connectRetryCount=0, an immediate exception is thrown when connecting to an offline database.

Actual behavior

With connectRetryCount = 0, exception is thrown after 30 seconds (duration of default loginTimeout) when connecting to an offline database.

Metadata

Metadata

Assignees

Labels

BugA bug in the driver. A high priority item that one can expect to be addressed quickly.

Type

No type

Projects

Status

Closed Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions