0 Replies Latest reply on Jan 7, 2003 5:44 PM by jeffelo

    SQLException: Network error socket closed

    jeffelo

      I'm connecting from JBoss 3.0.4 to MS SQL Server 7 (using the jTds driver), and every once in a while one by one the database connections fail with the following exception:

      java.sql.SQLException: Network errorSocke
      t closed
      2003-01-07 14:48:28,029 ERROR [STDERR] at net.sourceforge.jtds.jdbc.Tds.submitP
      rocedure(Unknown Source)
      2003-01-07 14:48:28,030 ERROR [STDERR] at net.sourceforge.jtds.jdbc.Tds.rollbac
      k(Unknown Source)
      2003-01-07 14:48:28,030 ERROR [STDERR] at net.sourceforge.jtds.jdbc.TdsConnecti
      on.commitOrRollback(Unknown Source)
      2003-01-07 14:48:28,030 ERROR [STDERR] at net.sourceforge.jtds.jdbc.TdsConnecti
      on.rollback(Unknown Source)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local
      .LocalManagedConnection.rollback(LocalManagedConnection.java:273)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.resource.connectionmanager.
      LocalTxConnectionManager$LocalConnectionEventListener.rollback(LocalTxConnection
      Manager.java:658)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.tm.TxCapsule.rollbackResour
      ces(TxCapsule.java:1779)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.tm.TxCapsule.rollback(TxCap
      sule.java:475)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.tm.TransactionImpl.rollback
      (TransactionImpl.java:83)
      2003-01-07 14:48:28,030 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCM
      T.runWithTransactions(TxInterceptorCMT.java:191)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCM
      T.invoke(TxInterceptorCMT.java:60)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterce
      ptor.invoke(SecurityInterceptor.java:130)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.
      invoke(LogInterceptor.java:204)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContain
      er.invoke(StatelessSessionContainer.java:313)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Contai
      ner.java:712)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.i
      nvoke(MBeanServerImpl.java:517)
      2003-01-07 14:48:28,031 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMP
      Invoker.invoke(JRMPInvoker.java:382)
      2003-01-07 14:48:28,031 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor33
      .invoke(Unknown Source)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorI
      mpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2003-01-07 14:48:28,032 ERROR [STDERR] at java.lang.reflect.Method.invoke(Metho
      d.java:324)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispa
      tch(UnicastServerRef.java:261)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Tra
      nsport.java:148)
      2003-01-07 14:48:28,032 ERROR [STDERR] at java.security.AccessController.doPriv
      ileged(Native Method)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCa
      ll(Transport.java:144)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.ha
      ndleMessages(TCPTransport.java:460)
      2003-01-07 14:48:28,032 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$Co
      nnectionHandler.run(TCPTransport.java:701)
      2003-01-07 14:48:28,032 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)


      It would seem that somehow the socket on an open connection got closed. Not sure why this has happened, possibly a SQL Server problem. My question is: is there a way to have the JBoss connection pool recover gracefully from this? Presently all it does is churn (waiting for something to happen with the current bad connections, I'd assume), using up all of the machine's cpu time, rather than just dropping the current connections and trying to reconnect. I didn't see any options for how to deal with this in the pool settings.

      Thanks,
      Jeff Elo