Scenario:
server SERV_A, database DBNAME primary
server SERV_B, database DBNAME standby with DB2_HADR_ROS enabled
Then this situation occurs:
- connection CON is made from client to DBNAME when primary is on SERV_A
- takeover DBNAME to SERV_B -> DBNAME becomes primary on SERV_B
- connection is rerouted with ACR (Automatic Client Reroute) to SERV_B
- takeover DBNAME back to SERV_A -> DBNAME becomes primary on SERV_A
- Connection CON does not goes back to SERV_A but remains connected to SERV_B in readolny mode.
How to avoid this situation? The active connection remains on standby database in read only mode until you restart the connection. Even worse with some apps which are using connection pools (Websphere Application Server) when you have to restart the entire application server to force the connection pool to first connect to primary server.
This occurs with ibm db2 dsdriver with ACR configured, jdbc driver type 4. Tested on multiple versions (fixpacks) of db2 10.5 and 11.