Hi,
I am using tomcat jdbc pool with microsoft (sqljdbc4) driver. The network team runs some network sweep once every week. After this process, the connections get closed. And it does not get connected again. Then we have to restart the servers. Is there a configuration which will help in getting the connection again?
Thanks.
I'm not entirely sure what you mean by a "network sweep". However, if your database connections are being closed for whatever reason, you need to configure your DataSource to detect the closed connections and evict them from the pool.
One way to do that is by adding the attributes testOnBorrow="true" and validationQuery="SELECT 1" (you might need to adjust the validation query for SQL Server compatibility).
With these options, jdbc-pool will execute the validation query on each connection prior to it's use by your applciation. If the validation query fails then the connection will be removed from the pool.
For more details, please see the documentation for jdbc-pool.
https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
Dan
Popular Links