Database High Availability and Failover

Have a two instance postgresql database cluster setup as one writer and the other in read only. A failover event changes the read only instance to write. How does one configure keycloak 15.0.2 to gracefully handle a failover from one instance to another instance. Currently the keycloak server logs PSQLException: This connection has been closed. And it never recovers or restores the connection after the failover.

Initially Keycloak was configured to use a single URL that would be updated during a failover event by pointing it to the address of the new active instance. I tried setting the networkaddress.cache.ttl to 10 in the gloval java.security file. No effect. Then, I tried setting -Djava.security.properties=/opt/rh-sso/java.security with the networkaddress.cache.ttl set to 10. No effect.

Next approach I tried was providing multiple hosts in the JDBC connection string and it did not respond to or handle a failover of the database between instances. And an unintended consequence was due to both instances normally being online with one write and the other read-only it would fail if/when the first host was in read only mode.

Is there a way to get keycloak to gracefully handle postgresql database failovers?

KC Version 15.0.2
OS Version RHEL 8.8
JDBC Version postgresql-42.2.24.jar

Thanks in advance