commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DBCP-233) Allow connection, statement, and result set to be closed multiple times
Date Mon, 16 Mar 2009 21:19:50 GMT

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

Mark Thomas resolved DBCP-233.
------------------------------

    Resolution: Fixed

The standard pattern of
Connection conn = null;
try {
  conn = ...
} finally {
  if (conn!=null) {
    try {
      conn.close();
    } catch (SQLException e) {
      // Ignore or log
    }
  }
}

should address all of the concerns outlined above. Note that you'll need to build DBCP from
svn to get the fix that allows multiple calls to close()

As Phil notes, the test cases cover this quite extensively. If you have a scenario/test case
that fails with the latest code from svn please re-open and describe your scenario so we can
investigate.

> Allow connection, statement, and result set to be closed multiple times
> -----------------------------------------------------------------------
>
>                 Key: DBCP-233
>                 URL: https://issues.apache.org/jira/browse/DBCP-233
>             Project: Commons Dbcp
>          Issue Type: Improvement
>            Reporter: Dain Sundstrom
>             Fix For: 1.3
>
>         Attachments: CloseTwice.patch
>
>
> This patch allows Connection, Statement, PreparedStatement, CallableStatement and ResultSet
to be closed multiple times.  The first time close is called the resource is closed and any
subsequent calls have no effect.  This behavior is required as per the JavaDocs for these
classes.  The patch adds tests for closing all types multiple times and updates any tests
that incorrectly assert that a resource can be closed more then once.
> This patch fixes DBCP-134 and DBCP-3

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message