tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Clark <>
Subject RE: Tomcat JDBC connection pool: Using initSql together with validatorClassName
Date Wed, 03 Dec 2014 18:42:37 GMT
These actions seems to incorrectly conflated in the code.  I'd also like to do the same thing,
so if you get it working, keep me posted.

-----Original Message-----
From: Iris Hupkens [] 
Sent: Wednesday, December 03, 2014 5:14 AM
To: ''
Subject: Tomcat JDBC connection pool: Using initSql together with validatorClassName


I am using the Tomcat JDBC connection pool (version 7.0.55) as a stand-alone library. The
connection pool is configured with a custom validator class in order to use the JDBC4 isValid
method for connection validation.  I would also like to use initSql to perform some preparation
on all connections created in the pool (such as setting sorting to case insensitive under
Oracle). However, it appears that initSql does not work in combination with a validator class.

Looking at the source, the code that executes the initSql statement is skipped if a validator
class is configured. The documentation for initSql states that it is executed in place of
the validation query when connections are initialized, but the method which does the validation
first checks if there is a validator class that should be used instead, and then returns immediately.

I was wondering: is this a bug, or is it intentionally not possible? If it's intentional,
is there perhaps a different way to configure the Tomcat connection pool to use both a custom
validator class and execute initial SQL statements when first creating a connection?

Kind regards,
Iris Hupkens

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message