Re: Fatal bug in Oracle JDBC OCI driver - Oracle admits it.

From: Thomas Kyte <>
Date: Sat, 22 May 1999 18:58:22 GMT
Message-ID: <>

A copy of this was sent to "Dean Willis" <> (if that email address didn't require changing) On Sat, 22 May 1999 18:22:23 GMT, you wrote:

>I've just spent two days checking everything in my system, and multiple
>calls to oracle technical support to find out that there is a problem in the
>Oracle JDBC OCI driver that Oracle thinks may or may not be a problem worth
>fixing. The driver builds a cursor when it does an insert and then fails to
>release that cursor. In addition to being a waste of resources, when you
>reach the number of inserts that is equal to your ORACLE MAX_CURSORS, you
>will abend with an ORA-01000 Max open cursors exceeded. The only workaround
>for this is to keep track of how many inserts you have made, and before it
>gets to the MAX_CURSORS limit, then you must disconnect and re-connect to
>the database. Keep in mind that Oracle and the drivers open cursors that
>you don't know about, so you are never really sure when you need to
>disconnect and reconnect to the database. Oracle has asked me to send them
>all my code, and the abend and everything else they could think of, because
>even though they know about this bug, they are not sure it is serious enough
>to fix. If you are only doing a few inserts, then it will only waste your
>resources, but if you are doing a real application that does many inserts,
>it will abend on you. I can't believe that Oracle is so arrogant about this
>to think it not a problem that needs fixing.
>These are the JDBC OCI drivers on the Oracle CD for Oracle 8.0.5, so I do
>not know if it affects other versions, but I would suspect so. We are also
>running Solaris 2.7 with JDK 1.1.

Do you have a test case? How are you executing the cursors? What are the circumstances?

For example, I just created a small table t ( x number ); my open_cursors is set to 1,000 on my system. I ran a java program:

import java.sql.*;
import oracle.jdbc.driver.*;

class test {
  public static void main (String args []) throws SQLException {

    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());

    // Connect to the local database
    Connection conn =

      //DriverManager.getConnection ("jdbc:oracle:thin:_at_slackdog:1521:oracle8",
      DriverManager.getConnection ("",
                                   "scott", "tiger");

    // Query the employee names
    Statement stmt = conn.createStatement ();

    stmt.execute( "delete from t" );

    for( int i = 0; i <= 2000; i++)

        stmt.execute( "INSERT INTO T VALUES (" + i + ")" ); }

that does 2001 inserts (plus the delete) which should have blown my max open cursors of 1,000 -- but it didn't. Can you post an example for us to work with? also -- if you have the tar number, let me know what it is -- i'll look at the work to date and see whats up.

See for my column 'Digging-in to Oracle8i'...  

Thomas Kyte
Oracle Service Industries
Reston, VA USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Sat May 22 1999 - 20:58:22 CEST

Original text of this message