Writing clob leaves open cursors

From: Joerg Koldehoff <joerg.koldehoff_at_gmx.de>
Date: 3 Apr 2002 08:03:41 -0800
Message-ID: <42d95f26.0204030803.5d98887b_at_posting.google.com>


Hi all !

I use jdbc driver for oracle classes12.zip and Oracle 8.1.7 and want to write a huge text in a clob. Here is the code fragment:

CLOB TextClob;
PreparedStatement _pstmt;
OracleResultSet rs = null;
int newID = getOID().intValue();

DBService dbservice = getDbs();
PreparedStatement stmt = dbservice.getPreparedStatement("update "+table+" set "+tabcol+"=empty_clob() where OID="+newID,"");

//Statement stmt = dbservice.createStatement(); stmt.executeUpdate("update "+table+" set "+tabcol+"=empty_clob() where OID="+newID);

String cmd = "SELECT "+tabcol+" FROM "+table+" WHERE OID="+newID+" for update";
rs = (OracleResultSet)stmt.executeQuery(cmd); if (rs.next())
{

        TextClob = rs.getCLOB(1);
}
else
{

        rs.close();
        stmt.close();
        return false;

}

// save LargeText to DB
Writer writer = TextClob.getCharacterOutputStream();

writer.write(text);
writer.flush();
writer.close();

rs.close();
stmt.close();

return true;

After the execute of this code I can see some new open cursors in the v_$open_cursor table. The new cursors will remain still the connection is closed.

Does anybody have the same problem ?? Received on Wed Apr 03 2002 - 18:03:41 CEST

Original text of this message