You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/03/07 14:48:13 UTC

DO NOT REPLY [Bug 17769] New: - pre-mature closing of Statement and PreparedStatement

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17769>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17769

pre-mature closing of Statement and PreparedStatement

           Summary: pre-mature closing of Statement and PreparedStatement
           Product: Commons
           Version: 1.0 Alpha
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: cctang0@mindspring.com


There is a problem with StatementUtils class of common-scaffold.  In 
executeQuery method, the statements,

            try {
                if (statement != null) statement.close();
                if (preparedStatement != null) preparedStatement.close();
            }
            catch (SQLException sqle) {}

result to closure of ResultSet.

(See javadoc of Statement close(): Note: A Statement object is automatically 
closed when it is garbage collected. When a Statement object is closed, its 
current ResultSet object, if one exists, is also closed. )

Then in ResultSetUtils.getElement(target,resultSet), the Resultset is used and 
causes exception thrown.

If you have any question, please let me know.

Chao Tang

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org