tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <>
Subject validationQuery with Tomcat 7 JDBC Pool
Date Mon, 29 Apr 2013 13:30:56 GMT

I was using validationQuery in Tomcat 6 for JNDI datasources, so to check
connections before borrowing to the caller
And, about documentacion, testOnBorrow parameter is true by default

testOnBorrow - true or false: whether a connection should be validated
using the validation query each time it is borrowed from the pool. Default:

And all works fine

Now , I want to use JDBC Pool with a new web application deployed on that
Tomcat 6.
So, I consider it as an standalone application, and I use
org.apache.tomcat.jdbc.pool.DataSource class ( I use Spring-MyBatis to
configure datasource , injecting it as a  bean)

I've read in Tomcat 7 JDBC pool documentation that testOnBorrow is false by
default in this case
Is it right ? Must I define testOnBorrow = true explicitly ?
It's little bit strange that default values be different either access by
JNDI or bean  instantiation

Should I use org.apache.tomcat.jdbc.pool.DataSourceFactory instead
of org.apache.tomcat.jdbc.pool.DataSource ?
My doubt is if one is better than other in performance terms

Should I use META-INF/context.xml and to use <Resource> ?

Thanks and regards

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message