garydgregory commented on a change in pull request #68:
URL: https://github.com/apache/commons-dbcp/pull/68#discussion_r497956762
##########
File path: src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
##########
@@ -77,6 +77,9 @@ public PoolingDataSource(final ObjectPool<C> pool) {
@Override
public void close() throws RuntimeException, SQLException {
try {
+ if (pool instanceof GenericObjectPool) {
+ ((PoolableConnectionFactory) ((GenericObjectPool<?>)
pool).getFactory()).close();
Review comment:
Should the cast to `PoolableConnectionFactory` be changed
`AutoCloseable` for a touch more flexibility?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]