pjj
pjj

Reputation: 2135

Can "maxAge" of "org.apache.tomcat.jdbc.pool.DataSourceFactory" impact active database connection

This is what is our PROD scenario:

So, this makes me wonder if this is because of maxAge of 900000. I read the docs of Apache and other blogs but no where I could find a clear answer whether maxAge will impact an active database connection or not.

From the docs only thing I am 100% sure of is that maxAge is checked when moving a database connection in or out of the pool, but I not sure on what happens once database connection is in use...

Has anyone having similar experience with this or knows if maxAge impacts an active connection or not?


UPDATE 1:

I am using Tomcat 8.5

Upvotes: 2

Views: 2361

Answers (1)

Chintan Barad
Chintan Barad

Reputation: 53

According to this it will not close your connection that's already in use. It rather checks for the age before returning it to the pool - after you released the connection. And closes if max age has elapsed. We went from no-max-age to 10 minutes and didn't see the issue you're reporting.

From the documentation,

When a connection is returned to the pool, the pool will check to see if the now - time-when-connected > maxAge has been reached, and if so, it closes the connection rather than returning it to the pool.

Upvotes: 1

Related Questions