I am building an app using Spring Boot with MSSQL. For connection pooling I am using Tomcat JDBC.
My question what happens to the connection pool when a database is taken offline for a few minutes and what is the best way to recover from this database going offline.
I have tried the following tomcat connection pool configuration and when the database was taken offline and then brought online new connections were not established. I keep gettin the exception com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
Tomcat JDBC Configuration:
primary.datasource.tomcat.testWhileIdle=true
primary.datasource.validationQuery=SELECT 1
primary.datasource.validationInterval=34000
primary.datasource.initial-size=10
primary.datasource.max-active=50
primary.datasource.max-idle=20
primary.datasource.min-idle=10
primary.datasource.timeBetweenEvictionRunsMillis=34000
primary.datasource.minEvictableIdleTimeMillis=55000
primary.datasource.removeAbandoned=true
primary.datasource.removeAbandonedTimeout=55000
Please note that I have two datasources configured