Springboot not clearing Hikari Pool when refreshing datasource
I am trying to update my datasource with dynamic credentials that I get via Hashicorp Vault. I followed this tutorial: https://developer.hashicorp.com/vault/tutorials/app-integration/spring-reload-secrets This works very well and reliably so far. However, I have the problem that every time I update the secrets, spring does not shut down the current hikari pool and instead open another one on top. So the current connections remain in MariaDB, which of course leads to the following message from MariaDb after a certain time: Too many connections. Even closing the datasources before the context.refresh doesn’t help.