commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hope, Matthew" <Matthew.H...@capitalone.com>
Subject RE: DBCP: Closed connections
Date Fri, 25 Apr 2003 17:44:08 GMT
Errrrm thanks but that was what I intended it to do :¬)

I was demonstrating that closing Statement also closed result set thus
closing the cursor (since I'm also using oracle I'm intruged as to whether
or not the problem Chris Forbis noted is reproducible)..

Sorry - I should be consistent in my reply below the quote but outlook makes
this a pain.

Matt

-----Original Message-----
From: Nelson, Laird [mailto:Laird.Nelson@FMR.COM] 
Sent: 25 April 2003 18:41
To: 'Jakarta Commons Users List'
Subject: RE: DBCP: Closed connections


> -----Original Message-----
> From: Hope, Matthew [mailto:Matthew.Hope@capitalone.com]
> The following code can run 10,000 iterations no problems.

[snip]

> 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
code:

				ResultSet r = 
> s.executeQuery("select "+ i +"
> from dual");
> 				r.next();
> 				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.

Cheers,
Laird

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

Mime
View raw message