How to remove invalid database connection from pool

后端 未结 4 1966
广开言路
广开言路 2021-02-08 06:22

I am using connection pooling of tomcat with oracle database. It is working fine, but when i use my application after a long time it is giving

4条回答
  •  生来不讨喜
    2021-02-08 07:14

    This could be because on the db server, there is a timeout to not allow connections to live beyond a set time, or to die if it does not receive something saying it is still valid. One way to fix this is to turn on keepalives. These basically ping the db server saying that they are still valid connections.

    This is a pretty good link on Tomcats DBCP configurations. Take a look at the section titled "Preventing dB connection pool leaks". That looks like it may be a good place to start.

提交回复
热议问题