[Biojava-dev] Closing ResultSets and Statements in biosql package.

Len Trigg len at reeltwo.com
Thu Jul 31 17:16:31 EDT 2003


Guys,

FYI - I just committed a fix to a bug where I was getting the
following exception operating on sequences stored in Oracle:

Caused by: java.sql.SQLException: ORA-01000: maximum open cursors
exceeded
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
        at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:120)
        at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:586)
        at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:385)
        at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:413)
        at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:119)
        at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:92)
        at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:950)
        at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:802)
        at org.biojava.bio.seq.db.biosql.FeaturesSQL.retrieveFeatures(FeaturesSQL.java:271)
        at org.biojava.bio.seq.db.biosql.BioSQLAllFeatures.getFeatures(BioSQLAllFeatures.java:136)
        ... 9 more

The underlying cause was that in FeaturesSQL there were a bunch of
ResultSets and PreparedStatements that were not being explicitly
closed. These were hanging around open and exceeded the Oracle
OPEN_CURSORS parameter. I fixed the problem in this case, but there
may be similar problems in other parts of the package. I'm posting
this so there's a record if this crops up again (i.e.: before we get a
chance to make a pass through the package checking all cases where
this could occur :-)).


Cheers,
Len.



More information about the biojava-dev mailing list