commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nelson, Laird" <Laird.Nel...@FMR.COM>
Subject RE: DBCP: Closed connections
Date Fri, 25 Apr 2003 17:40:32 GMT
> -----Original Message-----
> From: Hope, Matthew []
> The following code can run 10,000 iterations no problems.


> Rem out the close of Statement and it bails on the 199th 
> attempt with too
> many open cursors...

Looks like you aren't closing your result sets.  Here's a snippet of your

				ResultSet r = 
> s.executeQuery("select "+ i +"
> from dual");
> 				r.getInt(1);
> 				store[i-1] = r; --prevent any gc side
> effects

You don't have an r.close() after the r.getInt(1).  When you do a
statement.close(), it will close any open ResultSets for you, but if you
"rem" that line out, as you put it, then the ResultSets that would otherwise
be closed are left dangling.

Hope that helps.


View raw message