commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DBUTILS-138) Exception in closing statement leave connections open
Date Fri, 04 May 2018 16:08:00 GMT

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

Gary Gregory updated DBUTILS-138:
---------------------------------
    Description: 
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}

  was:
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.
{noformat}
} finally {
try {
close(rs);
} finally {
close(stmt);
if (closeConn) {
close(conn);
}
}
}{noformat}


> 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)

Mime
View raw message