commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22214] - Delegating ResultSet causing NPE
Date Thu, 07 Aug 2003 13:49:18 GMT
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=22214>.
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=22214

Delegating ResultSet causing NPE





------- Additional Comments From marty_f_rose@hotmail.com  2003-08-07 13:49 -------
At a glance it appears to me that the latest code in CVS should not be doing this...

If you look at
{DelegatingCallableStatement/DelegatingPreparedStatement/DelegatingStatement},
and look at their getResultSet() methods, they do the following:

    public ResultSet getResultSet() throws SQLException {
        checkOpen();
        return DelegatingResultSet.wrapResultSet(this,_stmt.getResultSet());
    }

And if we go look at DelegatingResultSet.wrapResultSet(ResultSet rs) :

    public static ResultSet wrapResultSet(Statement stmt, ResultSet rset) {
        if(null == rset) {
            return null;
        } else {
            return new DelegatingResultSet(stmt,rset);
        }
    }

And the sample code snippet I wrote doesn't seem to do this either...  
        Connection conn = null;
        try {
            conn = ConnectionFactory.getConnection("ORBIDSS"); // Get A Pooled
Connection
            Statement stmt = conn.createStatement();
            stmt.execute("update table set table_id=1 where table_id=1000000");
            log.warn("" + (stmt.getResultSet() == null));
        } catch( Throwable t ) {

        } finally {
            util.Utilities.closeConnection(conn);
        }

Could you make sure you're using the released dbcp, and if possible post some
generic code that I could see how you're using this to get it to break???

Mime
View raw message