behavior of a Sql Server availability group listener and a jdbc client during a failover? i have a question about the behavior of the AG listener during a failover... when the failover happens, I realize that all the connections on both primary and secondaries are closed.
if the client apps are using one of the blessed client libraries (such as microsoft jdbc &gt; 6.0) they will then start immediately trying to reconnect to the ip addresses associated with the listener. But what happens during the 10 second period (or whatever it is) for the failover to complete? Might a client successfully get a connection, only to get a fatal error message when it tries to use it? Or is something done to ensure that no client will get a connection successfully during failover itself, so that that when a client does successfully get a connection, it is actually usable?
(FYI regarding the behavior of the microsoft jdbc driver, judging from the source code at:
https://github.com/microsoft/mssql-jdbc/blob/dev/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
It will divide the configured loginTimeout by 8 and so make 8 attempts before timing out.)
My understanding is that no client is going to be able to connect to the Listener and get a database connection until the failover completes. Look at the section &quot;How Automatic Failover Works&quot; in the following link. See here