Other information because I don't know what to do.

The exception is created when I call my function getConnection(). The code is 
when I execute "con =  ds.getConnection();". 

The code is:

static {
    try  {
        Context initCtx = new InitialContext();
        System.out.println("[DEBUG] Dopo l'InitialContext = " + 
initCtx.toString());
        Context envCtx = (Context) initCtx.lookup("java:comp/env");
        System.out.println("[DEBUG] Dopo lookup java:comp/env = " + 
envCtx.toString());
        DataSource ds = (DataSource) envCtx.lookup(dbName);
        System.out.println("[DEBUG] Datasource = " + ds.toString());
        con =  ds.getConnection();
        if (con == null)
          System.out.println("[ERROR] Connessione nulla");
      } catch (Exception ex) {
        System.out.println("[ERROR] Errore = "  + ex.toString() + " \n" + 
ex.getMessage());
        con = null;
      }
  }


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



Please help me.
Before this code was ok. Has someone some idea?

Help.


Laura


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to