You may want to look into these two classes from oracle.
oracle.jdbc.oci.OracleOCIConnection
oracle.jdbc.pool.OracleOCIConnectionPool


They should be in the classes12.jar.
This will preclude you from using the thin driver, but probably provide more
stability in connection pooling.

Read Oracle documentation here.
http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/index.htm


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, October 03, 2002 3:47 AM
To: tomcat-user
Subject: Please help me!!

Hi all,

I can't find an answer to this question. Plese help me.

I have an apache-tomcat(4.0.3) system installed. I use a connection 
DataSource with a Oracle database (I have a resource in server.xml with 
type="javax.sql.DataSource"). ---> Instruction in the JNDI Resources 
HOW-TO section of Tomcat 4.0.x.

My question is this. If Oracle DB crashes and it has to been restarted, 
does my web application,that uses DataSource, have to be restarted? 

I have a class with this static block:

static {
    try  {
        Context initCtx = new InitialContext();
        Context envCtx = (Context) initCtx.lookup("java:comp/env");
        DataSource ds = (DataSource) envCtx.lookup(dbName);
        con =  ds.getConnection();
        if (con == null)
          System.out.println("[ERROR] Connection null");
      } catch (Exception ex) {
        System.out.println("[ERROR] Errore = "  + ex.toString() + " \n" 
+ ex.getMessage());
        con = null;
      }
  }
 
and I have a method:


protected synchronized Connection getConnection() {
         while (conFree == false) {
            try {
               wait();
            } catch (InterruptedException e) {
              System.out.println("[ERROR] Exception getConnection() = " 
+ e.toString());
            }
         }
         conFree = false;
         notify();
         return con;
    }

In the servlets of my web application I call getConnection() to take 
the connection: if db is restarted what happen?

Thanks for your help

Laura



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to