I've set up an Availability Group on SQL Server (on Azure VMs) and created a Distributed Network Name as the listener for this. (SQL Server 2019 on Windows 2019)
If I connect to that listener in SMS then it works fine. If I manually failover and re-connect in SSMS it again works fine. Running
select @@SERVERNAME in both cases returns the primary server.
However, if I leave the original connection open, and later try
select @@SERVERNAME then it still returns the server it connected to (which is now secondary). I can verify this by trying to INSERT a row and it tells me this server now needs a READ ONLY INTENT connection and I can't do an update.
Is it expected that you have to open a new connection after a (manual) failover event?