You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/05/04 16:22:00 UTC

[jira] [Updated] (DBUTILS-138) org.apache.commons.dbutils.QueryRunner.query(Connection, boolean, String, ResultSetHandler, Object...) Exception in closing statement leave connections open

     [ https://issues.apache.org/jira/browse/DBUTILS-138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated DBUTILS-138:
---------------------------------
    Summary: org.apache.commons.dbutils.QueryRunner.query(Connection, boolean, String, ResultSetHandler<T>, Object...) Exception in closing statement leave connections open  (was: Exception in closing statement leave connections open)

> org.apache.commons.dbutils.QueryRunner.query(Connection, boolean, String, ResultSetHandler<T>, Object...) Exception in closing statement leave connections open
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DBUTILS-138
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-138
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.7
>         Environment: SQL Server 2012, Java 8, MS JDBC Driver 4.
>            Reporter: Stefano Lissa
>            Priority: Minor
>              Labels: connectionloss
>
> On class QueryRunner starting at line 393 (see the snippet below) if the statement close attempt results in an exception, the connection is not closed correctly. I was not able to intercept the exception since it happens in a production environment with SQL Server 2012, Java 8 and original MS drivers, but the effect is the connection pool fills up and finally starts to log abandoned connections opened by QueryRunner.
> {code:java}
>         } finally {
>             try {
>                 close(rs);
>             } finally {
>                 close(stmt);
>                 if (closeConn) {
>                     close(conn);
>                 }
>             }
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)