Our JNDI connection pool on tomcat (8.0) does not reconnect after MS SQL Server( 2014) restarts. unless, I restart the tomcat , the DB connection pool remains in state of closed connection , even though the SQL server is up. But if I provide DB URL details instead of JNDI, the connection pool restores the connection post a restart of SQL Server, and does not demand and restart of the tomcat.
This happens also when SQL Server failovers in availability cluster , though the secondary becomes active in DB availability cluster.
Please let me know if any property needs to be additionally defined for this work.
Tried with autoReconnect=true, but that doesn't work. Please do help on the what is auto reconnect property to set to JNDI configuration
The JNDI config is
auth="Container"
type="javax.sql.DataSource"
initialSize="10"
maxActive="100"
maxIdle="10"
minIdle="0"
maxWait="1000000"
timeBetweenEvictionRunsMillis=
minEvictableIdleTimeMillis="
validationQuery="SELECT 1"
validationInterval="1000"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
removeAbandoned="true"
removeAbandonedTimeout="3000"
logAbandoned="true"
username="XX"
password="XX"
factory="org.apache.tomcat.
driverClassName="com.
url="jdbc:sqlserver://
Below is stack trace :
[SQLErrorCodesFactory] Error while extracting database product name - falling back to empty error codes
org.springframework.jdbc.
erException: The connection is closed.
at org.springframework.jdbc.
at org.springframework.jdbc.
at org.springframework.jdbc.
at org.springframework.jdbc.
at org.springframework.jdbc.
at org.springframework.jdbc.
at org.springframework.jdbc.core.
at org.springframework.jdbc.core.
at org.springframework.jdbc.core.
Caused by: com.microsoft.sqlserver.jdbc.
at com.microsoft.sqlserver.jdbc.
at com.microsoft.sqlserver.jdbc.
at com.microsoft.sqlserver.jdbc.
at sun.reflect.
at sun.reflect.
at java.lang.reflect.Method.
at org.apache.tomcat.jdbc.pool.
at org.apache.tomcat.jdbc.pool.
at org.apache.tomcat.jdbc.pool.
at com.sun.proxy.$Proxy4.
Thanks,
Nivedita