I keep on getting this nasty message every now and then... It disappears on reboot and on opening/closing the Sybase Central software...
 
java.sql.SQLException: JZ0C0: Connection is already closed.
        at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:439)
        at com.sybase.jdbc2.jdbc.SybConnection.checkConnection(SybConnection.java:1519)
        at com.sybase.jdbc2.jdbc.SybConnection.getWarnings(SybConnection.java:936)
        at com.sybase.jdbc2.tds.Tds.doLogin(Tds.java:503)
        at com.sybase.jdbc2.tds.Tds.login(Tds.java:349)
        at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213)
        at com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
        at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
        at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
        at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
        at com.evermind.sql.DriverManagerDataSource.getConnection(JAX)
        at com.evermind.sql.DriverManagerConnectionPoolDataSource.getPooledConnection(JAX)
        at com.evermind.sql.OrionPooledDataSource.eh(JAX)
        at com.evermind.sql.OrionPooledDataSource.d3(JAX)
        at com.evermind.sql.OrionPooledDataSource.getConnection(JAX)
        at se.flowinteractive.common.db.DB.getConnection(DB.java:71)
        at se.flowinteractive.watson.bb.beans.BBCache.reCache(BBCache.java:121)
        at se.flowinteractive.watson.bb.beans.BBCache.<init>(BBCache.java:53)
        at se.flowinteractive.watson.bb.servlets.BBStartUpServlet.init(BBStartUpServlet.java:19)
        at javax.servlet.GenericServlet.init(GenericServlet.java)
        at com.evermind.server.http.HttpApplication.wo(JAX)
        at com.evermind.server.http.HttpApplication.v6(JAX)
        at com.evermind.server.http.HttpApplication.wh(JAX)
        at com.evermind.server.http.HttpApplication.vs(JAX)
        at com.evermind.server.http.HttpApplication.<init>(JAX)
        at com.evermind.server.Application.ue(JAX)
        at com.evermind.server.http.ej.ue(JAX)
        at com.evermind.server.http.ei.um(JAX)
        at com.evermind.server.http.ei.f9(JAX)
        at com.evermind.server.http.ej.uq(JAX)
        at com.evermind.server.http.ej.f9(JAX)
        at com.evermind.server.ApplicationServer.apd(JAX)
        at com.evermind.server.ApplicationServer.f9(JAX)
        at com.evermind.server.hc.run(JAX)
        at java.lang.Thread.run(Unknown Source)
        at com.evermind.util.f.run(JAX)
 
Line 71 in DB.java reads :
 
  return ds.getConnection();
and ds is initialized by :
 
static { 
  String dbsource = "jdbc/BBPooledDS";
   
  try
  {
   javax.naming.Context ctx = new javax.naming.InitialContext();      
   ds = (javax.sql.DataSource)ctx.lookup(dbsource);      
  }
  catch(javax.naming.NamingException namExc)
  {
   ds = null;      
   throw new java.lang.RuntimeException("Failed to get datasource!!");
  }
 }
 
 
Why am I getting a connection already closed? ( its on startup of the system... loadonstartup set on BBStartUpServlet).
 
The servlet loads "everything" from the database and store them in "cache" using singleton pattern, which means it happens on the first database access from the application. The connection should not be closed already, but maybe it is not inited yet?
 
regards
 
 
 
Johan Fredriksson

Reply via email to