Hello Rajendra,

For instance if you are using MYSQL a validationQuery="l" in your
datasource configuration [1] plus the magic autoreconnect parameter in the
URL can do the trick for you. However this can have side effects (see the
mysql autoreconnect description).

In my experience the cheapest option use to be to restart your application.

Hope it helps,

Luis

[1] https://commons.apache.org/proper/commons-dbcp/configuration.html
[2]
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html



El lun., 18 mar. 2019 a las 17:24, Rajendra (<rajendrapopur...@gmail.com>)
escribió:

> Hi,
>
> Tomcat(8.5.32) is not establishing connections to database after database
> is restarted. Currently, I am restarting Tomcat instance if DB is
> restarted. Please let me know any parameters need to be added to datasource
> resource element in Tomcat in order to establish database connections
> automatically after database back into online.
>
> Thanks !
>
> Rajendra
>
>

-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett

Reply via email to