# Keycloak-x database reconnection

**URL:** <https://forum.keycloak.org/t/keycloak-x-database-reconnection/14339>\
**Category:** Getting advice\
**Created:** [March 16, 2022, 7:35am UTC](https://forum.keycloak.org/t/keycloak-x-database-reconnection/14339 "2022-03-16T07:35:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michimau](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/michimau/32/4162_2.png) [@michimau](https://forum.keycloak.org/u/michimau)\
**Post date:** [March 16, 2022, 7:35am UTC](https://forum.keycloak.org/t/keycloak-x-database-reconnection/14339/1 "2022-03-16T07:35:20Z")

</div>

Dear keycloakers,

I have set up my database layer as an high availability cluster of postgres, with the use of pgpool.  
The simulation of fallback and recovery of the postgres instances works well.  
Keycloak-x is connecting via pgpool to the database cluster.

Problem:  
when pgpool switches from one postgres instance to another, there’s a couple of seconds of disconnection. The connection to any clients (and so keycloak-x) is closed too.

Keycloak-x doesn’t seem to e capable to reconnect automatically: a restart is required.

Is there something i am missing in the keycloak database configuration?

---

<div class="post-metadata">

**Author:** ![michimau](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/michimau/32/4162_2.png) [@michimau](https://forum.keycloak.org/u/michimau)\
**Post date:** [March 17, 2022, 7:59am UTC](https://forum.keycloak.org/t/keycloak-x-database-reconnection/14339/2 "2022-03-17T07:59:47Z")

</div>

I have found this to tackle the same issue in keycloak:

> <https://stackoverflow.com/questions/54865086/keycloak-not-able-to-connect-external-db-after-database-restart>

I am wondering if there’s anything similar usable in keycloak-k
