PooledDataSource.pingConnection() should be simplified to use the real connection's isValid() method (leave the old code in optionally, for the case the JDBC driver does not support this correctly).

Also, pingConnection() is protected, but you cannot overwrite it in subclasses to achieve the above, as PooledConnection is package private. That combination doesn't help much :-)

Comment From: kazuki43zoo

Sorry for a late reply.

use the real connection's isValid() method

I will consider to apply it.

Also, pingConnection() is protected,

I think you can override the ping method using extending class of PooledDataSource and UnpooledDataSourceFactory because the PooledConnection#isValid() delegates the PooledDataSource#pingConnection. WDYT?

Thanks.

Comment From: axeld

Indeed, that should work.

Comment From: harawata

It looks like the problem has been resolved. Closing.