1

While creating a JdbcInterceptor for Tomcat jdbc-pool, one can override the method reset(ConnectionPool parent, PooledConnection con), which will called every time the connection is borrowed from the pool.

Is there a way to detect if this is the first time a particular underlying connection is being borrowed from the pool?

I could code something in my interceptor to "remember" and then check this each time, but I wonder if there is some type of property on the PooledConnection that I can check. I tried isInitialized(), but that is always true in the reset() method.

http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Interceptors

4

0 回答 0