Guillaume
Guillaume

Reputation: 18875

Recycling JDBC connections after some time

I have an application using an Oracle RAC database. To execute maintenance tasks on the database nodes, I'd like to migrate all connections away from database node 1, then switch the node off for maintenance.

What I would like is to make sure that database connections dont stay open for more than X minutes. When a DB node is put in maintenance, the connections opened on that node will be closed after at most X minutes and recreated on the other.

The connection pool used is common-dbcp, with the intention to move to tomcat-jdbc. For both pool, I cant see a configuration option to force recycling the connections after some time. Am I missing something ? Or is this not a standard option ?

Upvotes: 4

Views: 2168

Answers (1)

Guillaume
Guillaume

Reputation: 18875

Looking at the tomcat-jdbc documentation, I see that there is a maxAge parameter that does almost what I need. I'll run some checks next week to confirm and will update this answer to reflect my findings.

Upvotes: 2

Related Questions