Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: open_cursors question
I have encountered this with other developers before. Yes, they were
closing ResultSet, Statement and Connection objects. But the question
is, where? Are they cleaning things up right after finish using it?
All it takes is a nested loop of two ResultSet:
while (rset1.next()) {
while (rset2.next() {
}
}
rset1.close();
rset2.close();
All it takes is rset1 return 50 rows and rset2 return 100 rows, and your 5000 open cursors are done.
They should, of course do:
while (rset1.next()) {
while (rset2.next()) {
}
rset2.close();
}
rset1.close();
Best regards,
Richard Ji
On 7/28/06, Bobak, Mark <Mark.Bobak_at_il.proquest.com> wrote:
>
>
> Sandy,
>
> I'm a DBA, not a Java developer, but, as I recall, not only does the
> developer need to close the resultset, but also the statement. (Using the
> stmt.close() method.)
>
> A bit of info is available in MetaLink Doc ID 118756.1, Oracle JDBC
> Frequently Asked Questions.
>
> Hope that helps,
>
> -Mark
>
> --
> Mark J. Bobak
> Senior Oracle Architect
> ProQuest Information & Learning
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Jul 31 2006 - 10:46:51 CDT
![]() |
![]() |