avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@silveregg.co.jp>
Subject Re: Bug in AbstractJdbcConnection class - not closing result set from test
Date Wed, 20 Feb 2002 02:29:27 GMT

Leif Mortenson wrote:

> In the AbstractJdbcConnection a single statement is being opened and 
> kept around for the Keep Alive feature.   Each time the database is 
> pinged, the same statement is reused to execute query.  According to 
> the Javadocs,  this should be closing  any previous ResultSets.  So 
> this shouldn't have been a problem.  Is this a known place where 
> Oracle does not conform to the JDBC standard?  We only use MySQL, 
> PostgreSQL and HSQL and they all seem fine. 

According to this page: 

      Memory Leaks and Running Out of Cursors

If you receive messages that you are running out of cursors or that you 
are running out of memory, make sure that all of your Statement and 
ResultSet objects are explicitly closed. The Oracle JDBC drivers do not 
have finalizer methods; they perform cleanup routines by using the 
close() method of the ResultSet and Statement classes. If you do not 
explicitly close your result set and statement objects, serious memory 
leaks could occur. You could also run out of cursors in the database. 
Closing a result set or statement releases the corresponding cursor in 
the database.

Similarly, you must explicitly close Connection objects to avoid leaks 
and running out of cursors on the server side. When you close the 
connection, the JDBC driver closes any open statement objects associated 
with it, thus releasing the cursor objects on the servers side.


Oracle JDBC drivers do NOT seem to be following the JDBC spec.  So It 
looks like all Statements and ResultSets do need to be closed?  


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

View raw message