1 Reply Latest reply on Dec 15, 2004 10:13 AM by Ulf Schroeter

    java.sql.SQLException: Io exception: Connection reset

    lee_yuki2000 Newbie

      Hi,
      Does any one know why i have this error java.sql.SQLException: Io exception: Connection reset. It happens once a while in the application. I am just wondering is it all the connections are used? Or the connection timeout is too long? I am using jboss 3.2.3 and oracle 9. My setting for oracle-ds.xml is as below:



      <local-tx-datasource>
      <jndi-name>ORA</jndi-name>
      <connection-url>jdbc:oracle:thin:@10.10.10.1:1521:dev</connection-url>

      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>xx</user-name>
      xxx
      <min-pool-size>10</min-pool-size>
      <max-pool-size>300</max-pool-size>
      <blocking-timeout-millis>1500000</blocking-timeout-millis>
      <idle-timeout-minutes>30</idle-timeout-minutes>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>


      The error is as below:

      2004-12-18 00:44:59,829 ERROR [STDERR] java.sql.SQLException: Io exception: Connection reset
      2004-12-18 00:44:59,831 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      2004-12-18 00:44:59,832 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
      2004-12-18 00:44:59,832 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
      2004-12-18 00:44:59,832 ERROR [STDERR] at oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java:1260)
      2004-12-18 00:44:59,832 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkTransaction(BaseWrapperManagedConnection.java:395)
      2004-12-18 00:44:59,832 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:760)
      2004-12-18 00:44:59,832 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:208)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.JDBCProfile.prepareCachedStatement(JDBCProfile.java:334)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.JDBCProfile.getCachedStatement(JDBCProfile.java:192)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getCachedStatement(CachedStatementProfileWrapper.java:157)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.IterConvertProfile.getCachedStatement(IterConvertProfile.java:113)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getCachedStatement(CachedStatementProfileWrapper.java:157)
      2004-12-18 00:44:59,832 ERROR [STDERR] at sqlj.runtime.profile.ref.UntypedSelectProfile.getCachedStatement(UntypedSelectProfile.java:109)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getCachedStatement(CachedStatementProfileWrapper.java:157)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.ParamRegProfile.getCachedStatement(ParamRegProfile.java:57)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getCachedStatement(CachedStatementProfileWrapper.java:157)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.PositionedProfile.getCachedStatement(PositionedProfile.java:162)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getCachedStatement(CachedStatementProfileWrapper.java:157)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.TransactionControlProfile.getCachedStatement(TransactionControlProfile.java:164)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:1091)
      2004-12-18 00:44:59,833 ERROR [STDERR] at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:613)


      I am setting the blocking-timeout-millis to 1500000 milisecond which is 25 minutes. Is it too long? The reason why it is set to 25 minutes is because sometimes when the application is trying to get connection it will return null pointer exception. I am trying to set the waiting time longer so that it will wait for the next connection. However i still get null pointer exception once a while. I am not sure why does it happen since i have already set the maximum connectins to 300. There isn't many user using the system. It's about 10 users.


      Besides that, sometimes when the application is updating the database, and before the updating process finish, the connection is closed. And it will return null pointer exception. The updating process maybe 1-2 minutes and i have already set the <idle-timeout-minutes> to 30 minutes. So it should wait till the updating process finish and then close the connection. The error is as below:


      2004-12-18 00:45:03,123 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at sqlj.runtime.profile.ref.RTStatementJDBCBase.releaseStatement(RTStatementJDBCBase.java:1257)
      at sqlj.runtime.profile.ref.RTStatementJDBCBase.checkClose(RTStatementJDBCBase.java:954)
      at sqlj.runtime.profile.ref.RTStatementJDBCBase.executeComplete(RTStatementJDBCBase.java:937)
      at sqlj.runtime.ExecutionContext$StatementFrame.releaseStatement(ExecutionContext.java:1314)
      at sqlj.runtime.ExecutionContext.releaseStatement(ExecutionContext.java:980)
      at com.scan.prisma.cams.sqlj.filter.FilterDomain.editEventFlag(FilterDomain.java:1620)
      at com.scan.prisma.cams.ejb.session.filter.FilterManagerBean.updateEventFlag(FilterManagerBean.java:282)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
      at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:534)


      Anyone can help? Anything wrong with the oracle-dx.xml setting? Thanks in advance

      yuki

        • 1. Re: java.sql.SQLException: Io exception: Connection reset
          Ulf Schroeter Novice

          This is not a JBoss connection pool problem, as the SQL exception is caused by your ORACLE DB Server. It seems that your DB server is actively closing the connection during your prepareStatement() execution.

          <idle-timeout-minutes> only relates to unused connections within the connection pool. A connection in use (retrieved by getConnection()) will not be removed by the internal idle connection removal thread

          BTW you should upgrade to at least JBoss 3.2.6 as all prior versions have a connection pool synchronization bug that might lead to connection leaks under heavy load !

          Regards Ulf