Hi, I hope someone can point me into the right direction.
We have a AlwaysOn HADR setup with 2 servers, one primary and one secondary replica for a couple of databases. Synchronous Commit, Automatic Failover, Readable Secondary defined, No ReadOnly Routing.
-> AG Listener: SQL, IP *.*.*.229
An application recently started behaving weird when a fail-over from one server to the other occurs. It seems to be re-connecting to the wrong (now secondary) server and thus will see an appropriate error message (DB is readonly) upon writing attempts.
At the time of fail-over the application sees the following error message:
"Unable to access database 'Execution' because its replica role is RESOLVING which does not allow connections. Try the operation again later."
-> this is expected,
a few (~10) seconds later the same application gets the following error
"The target database ('Execution') is in an availability group and is currently accessible for connections when the application intent is set to read only."
or the one that the target database is read-only
I have checked the connection string of the application. It is using the AG listener DNS name [SQL], and [SQL] is always resolved to IP *.*.*.229
Now I am wondering why the application hangs on to the wrong server?
Kind regards, Frank