Chris,
Thank you for your quick response. We are planning to use the combination of 
one of these below in production. Our application is a high volume application 
with transactions per second of about 20. Just wondering for the recommended 
value for validationInterval.

Option1:
testOnBorrow = true
validationInterval = 300000 (5 mins)

Option2: 
testOnBorrow = true
validationInterval = 300000 (5 mins)
validationQuery = "SELECT 1 from SYSIBM.SYSDUMMY1"

Along with the above option1 or option2 can we add the below parameters also?
testWhileIdle = true
removeAbandoned = true
removeAbandonedTimeOut = 6000 (max response time for our application taken from 
splunk) max-idle = 2 min-idle = 2 minEvictableIdleTimeMillis = 60000 (60 
seconds) timeBetweenEvictionRunsMillis = (5000)

Thanks,
Sri Kota
Scrumbelievables
(904) 954 5113 (W)


> Hello, We are on Tomcat 8.5.23. We are trying to add fix to recover 
> application after database restart.
> 
> Here are our versions:
> 
> Tomcat 8.5.23 DB2 version: 11.1 JDBCDriver: DB2JCC 4.22.9
> 
> Does testonBorrow = true issue a select statement to the database to 
> validate the connection or is that a OPING which is a lightweight RPC?

This depends upon a couple of things. Tomcat 8.5 uses DBCP2 as the default 
connection pool, but you can also use Tomcat's jdbc-pool connection-pool as 
well.

If you are using either of these two pools, then setting testOnBorrow="true" 
without setting a "validationQuery" will use the JDBC driver's isValid() method 
to determine whether or not the connection is okay. It's up to the driver to 
decide how to do that.

If you are using another connection-pool, it will depend upon whatever that 
pool decides to do.

Hope that helps,
- -chris

Reply via email to