I've been thrilled by the ability to just drop my application war files into the Wildfly directory and have something like 0-downtime deployment. That is, until recently, when my deployments fail until I restart Wildfly. Judging by my logs, its a postgres error about failure to create a connection (I'm using hikari-cp for pooling). I currently believe (after sniffing around for all sorts of explanations) it's the application failing to close its connection when one war is replaced with another, and the deployment fails until the designated time-out for the pool connection is met. I'm not sure whether this timeout depends upon Postgres settings or the connection settings I define within the app. In any case, assuming the error logs are correct in relaying errors from Postgresql, how can I improve my deployment process to alleviate this error? Should I be trying to define some tear-down that Immutant/Wildfly will perform, or changing my connection settings, or changing my database settings?
For what it's worth, here are my connection settings (mostly default):
#+BEGIN_SRC clojure
{:database-name "dbname"
:adapter "postgresql"
:auto-commit true
:register-mbeans false
:password "pass"
:port-number 5432
:username "name"
:max-lifetime 1800000
:minimum-idle 10
:connection-timeout 30000
:server-name "
db.server.com"
:read-only false
:maximum-pool-size 10
:idle-timeout 600000
:validation-timeout 5000
:pool-name "db_pool"}
#+END_SRC