Oracle OCI driver: Garbage after a failed getConnection()

Oracle OCI driver: Garbage after a failed getConnection()

Post by Ole Streiche » Sat, 16 Jun 2001 00:26:26



Hi!

I have some trouble to get a server program using the Oracle OCI
driver running. When I execute the following program:

------------------------------8<-----------------------------------------
import java.sql.*;

class OraTest {
  public static void main(String args[]) {
    try {
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    } catch (SQLException e) {
      e.printStackTrace();
      System.exit(1);
    }

    Connection conn = null;

    while (conn == null) {
      try {

                                           "icke", "falsch");
        Thread.sleep(1000);
      } catch (Exception e) {
        e.printStackTrace();  
      }
    }
    System.out.println("Connection " + conn);
  }

Quote:}

------------------------------8<-----------------------------------------

with a valid connection string, I get the (correct) exceptions

java.sql.SQLException: ORA-01017: invalid username/password; logon denied
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
[...]

However, the TCP conncection to the data base remains after every try,
and also the Oracle processes which were created remain. After a short
time, the process table of the data base server is full, and I have to
kill the process above.

Is this a known bug?

Is there any good workaround for that? How do I need to handle login
failures in a server so that failed logins dont produce garbage?

I use Oracle 8.1.6 on Linux. With the "thin" driver, everything looks
OK.

Any suggestions?

Ole

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by Ole Streiche » Sat, 16 Jun 2001 15:50:38


Hi!

I have some trouble to get a server program using the Oracle OCI
driver running. When I execute the following program:

------------------------------8<-----------------------------------------
import java.sql.*;

class OraTest {
  public static void main(String args[]) {
    try {
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    } catch (SQLException e) {
      e.printStackTrace();
      System.exit(1);
    }

    Connection conn = null;

    while (conn == null) {
      try {

                                           "icke", "falsch");
        Thread.sleep(1000);
      } catch (Exception e) {
        e.printStackTrace();  
      }
    }
    System.out.println("Connection " + conn);
  }

Quote:}

------------------------------8<-----------------------------------------

with a valid connection string and an invalid user/password pair, I get
the (correct) exceptions

java.sql.SQLException: ORA-01017: invalid username/password; logon denied
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
[...]

However, the TCP conncection to the data base remains after every try,
and also the Oracle processes which were created remain. After a short
time, the process table of the data base server is full, and I have to
kill the process above.

Is this a known bug?

Is there any good workaround for that? How do I need to handle login
failures in a server so that failed logins dont produce garbage?

I use Oracle 8.1.6 on Linux. With the "thin" driver, everything looks
OK.

Any suggestions?

Ole

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by N. J. O'Nei » Sun, 17 Jun 2001 01:25:15


Sounds like this bug (from the 8.1.6.2.0 JDBC driver release notes
list of bug fixes):

 Bug 113152   Invalid connection consume a process leading to ORA-20

               Description:
               Each invalid connection (which can't be closed,
               e.g. incorrect password) consumes a process on the
               system.  When the number of processes exceeds processes
               parameter in the init.ora, ora-20 ORA-00020: maximum
               number of processes (50) exceeded.

Try upgrading your driver to version 8.1.6.2.0 or better.  This solved
the problem for me.

--N. J. O'Neill


> However, the TCP conncection to the data base remains after every try,
> and also the Oracle processes which were created remain. After a short
> time, the process table of the data base server is full, and I have to
> kill the process above.

> Is this a known bug?

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by Ole Streiche » Tue, 19 Jun 2001 17:23:21


Hello N.J.!


Quote:> Try upgrading your driver to version 8.1.6.2.0 or better.  This solved
> the problem for me.

Where do I get the updated driver?

Ole

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by N. J. O'Nei » Wed, 20 Jun 2001 01:52:56


You can get the drivers directly from Oracle:

  http://otn.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm

You may have to sign up for an "Oracle Technology Network" account,
but I believe that such accounts are free.
(http://otn.oracle.com/admin/account/membership.html)

--N.J. O'Neill


> Where do I get the updated driver?

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by Ole Streiche » Wed, 20 Jun 2001 18:47:10


Hello N.J.!


Quote:> You can get the drivers directly from Oracle:
>   http://otn.oracle.com/software/tech/java/sqlj_jdbc/software_index.htm
> You may have to sign up for an "Oracle Technology Network" account,
> but I believe that such accounts are free.
> (http://otn.oracle.com/admin/account/membership.html)

I did that, but I found only drivers for NT and Solaris; nothing for Linux.

Can I just use the Solaris one (they mentiuon it "pure java")?

Ole

 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by N. J. O'Nei » Thu, 21 Jun 2001 06:12:19


Yes, you should be able to use the "thin" (pure Java) driver on Linux,
unless there is some particular reason forcing you to use an OCI
driver.  Note that, despite some people's protestations that
"write-once-run-anywhere" is a fraud, the "thin" driver for both
Solaris and NT is actually the same code.


> ... but I found only drivers for NT and Solaris; nothing for Linux.

> Can I just use the Solaris one (they mentiuon it "pure java")?

> Ole

--N.J. O'Neill
 
 
 

Oracle OCI driver: Garbage after a failed getConnection()

Post by Ole Streiche » Thu, 21 Jun 2001 16:13:57


Hello N.J.!


Quote:> Yes, you should be able to use the "thin" (pure Java) driver on Linux,

This problem doesn't occur with my "thin" driver at all.

Quote:> unless there is some particular reason forcing you to use an OCI driver.

I am unfortunately forced to use the OCE driver: First of all, for
speed reasons. And the "thin" driver shows some problems using large/many
BLOBs.

That's why I was asking if I could just use the updated
"classes12.zip" in the Solaris package with my original (8.1.6)
libocijdbc8.so driver to solve the problem.

Tschuessi

Ole

P.S. This bug shows me, that OpenSource has a big advantage: If the
OCI driver would be open sources, I could patch the linux driver
myself. So I am bound to the fact that Oracle probably just forgot to
apply the bugfix to the Linux part.

 
 
 

1. Oracle OCI driver: Garbage after a failed getConnection()

Hi!

I have some trouble to get a server program using the Oracle OCI
driver running. When I execute the following program:

------------------------------8<-----------------------------------------
import java.sql.*;

class OraTest {
  public static void main(String args[]) {
    try {
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    } catch (SQLException e) {
      e.printStackTrace();
      System.exit(1);
    }

    Connection conn = null;

    while (conn == null) {
      try {

                                           "icke", "falsch");
        Thread.sleep(1000);
      } catch (Exception e) {
        e.printStackTrace();  
      }
    }
    System.out.println("Connection " + conn);
  }
------------------------------8<-----------------------------------------

with a valid connection string, I get the (correct) exceptions

java.sql.SQLException: ORA-01017: invalid username/password; logon denied
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
[...]

However, the TCP conncection to the data base remains after every try,
and also the Oracle processes which were created remain. After a short
time, the process table of the data base server is full, and I have to
kill the process above.

Is this a known bug?

Is there any good workaround for that? How do I need to handle login
failures in a server so that failed logins dont produce garbage?

I use Oracle 8.1.6 on Linux. With the "thin" driver, everything looks
OK.

Any suggestions?

Ole

2. Paradox locks

3. Oracle JDBC OCI runtime problem with getConnection (Unknown Source)

4. ? proper storage lobs params

5. Oracle Thin Driver works - Oracle OCI Driver does not

6. Small window for .EXE

7. Oracle oci driver: Core dump-oci parameter passed

8. ODBCDirect Connection and Recordsets

9. getConnection + mysql Driver + MS-Explorer 4.0 = No suitable drivers :(

10. OCI 73: using pl/sql tables in OCI fails

11. Oracle 8i: Cannot access db from Java using Oracle OCI driver

12. DriverManager.getConnection() fails under JDK 1.1.8 but not 1.2

13. getConnection() Failed: in JDBCTest