commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: [DBCP] DelegatingResultSet.close() -> NullPointerException
Date Tue, 17 Sep 2002 11:58:29 GMT
Yup - its a problem.

The following classes have this problem because getResultSet() doesn't 
check for a null return.
- DelegatingPreparedStatement
- DelegatingCallableStatement
- DelegatingPreparedStatement

I just submitted a bug report and patch to fix this.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12733


Andy Olliver wrote:
> DBCP v1.0
> I have had to make a quick fix to DelegatingResultSet to fix a problem.
> It is the 'wrong fix' but it keeps things working for me, until I have the
> correct fix.
> 
> I use a connection to execute a query that returns no resultset, however I
> still get a non-null DelegatingResltSet returned, containing a null
> resultset as instance variable '_res'.
> 
> Calling .close() throws a NullPointerException, however as a 'user' of the
> datasource there is no way of checking the state of private variabe '_res'.
> 
> I have added a check to the close method:
> 
> if (_res != null) _res.close;
> 
> But actually the DelegatingResultSet should never be created in the first
> place, the stmt.execute() method should just return null.
> 
> bests
> 
> Andy
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 
> 
> 


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


Mime
View raw message