1 2 Previous Next 17 Replies Latest reply on Jun 21, 2006 1:18 PM by 843859

    ORACLE driver: timeout => Connection reset by peer: socket write error ?

    416044
      I have the latest ORACLE JDBC driver 9201 for JDK 1.3. My servlet (running in weblogic server) works good during the day. But every morning, when i first access the servlet, I get the following exception when the first database access occurs:

      --------------
      java.sql.SQLException: E/A-Exception: Connection reset by peer: socket write error
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
           at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:417)
           at oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:470)
           at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:379)
           at de.deka.bav.sql.DBManager.select(DBManager.java:205)
           at de.deka.bav.sql.DBManager.getUserByLogin(DBManager.java:751)
           at de.deka.bav.security.UserManager.checkLogin(Unknown Source)
           at de.deka.bav.BavRequestBroker.processRequest(Unknown Source)
           at de.icomps.servlet.RoutingServlet.processPost(Unknown Source)
           at de.deka.bav.web.BavServlet.processPost(Unknown Source)
           at de.icomps.servlet.ICServlet.doPost(Unknown Source)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
           at de.icomps.servlet.ICServlet.service(Unknown Source)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
           at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
           at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
           at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
           at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
           at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
           at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
      -------------------

      after re-deploying my servlet it works again (until the next morning). what's the reason for this? in my code i check the database connection for isClosed() and == null to create a new connection if one of these checks returns true. but it doesn't help. Is there a kind of timeout in the ORACLE driver? and if so, how can i detect this?
        • 1. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
          843854
          Hi,

          These kind of errors will be thrown due to network break/glitches. Get an outage report from your network maintainnance team and proceed further
          • 2. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
            843854
            I also encountered same problem when i launch the browser the next day (the tomcat engine was on whole night)

            I checked with the DBA and she said the oracle doesnt timeout, by default.

            Could it be maxIdle and maxActive in server.xml file ? I plan to set this two parameters, esp maxIdle to 0 for 'indefinite'.

            ANy comments ?
            • 3. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
              843854
              Hi Hilpert!

              I think this problem is related to having the database server linked to the application server (Tomcat) through the Internet.

              I am having the same problem. The case is that our connection pooling framework has mora than 3 years of production use and this error never appeared. In fact, I could check that this is the first case when the database and application servers are remote to each other. Also, our client told us that the link between these servers sometimes is breaken for short periods of time. I also use Oracle DB with the driver version 9.

              I think that what happens is that the connections stablished between the servers are invalidate somehow not sensible to the standard Java methods that can detect such events.

              I am looking for a way of checking this link-failure event... As soon as I have a response, I can send the forum a result.

              Hope it helps!

              C ya,
              Ricardo.
              • 4. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
                843854
                Well i dont think, it is always the case. I have my webservers connected to the database using a 10-100MB switch which are like 5 ft apart on the same rack.
                Even then i get the same kinda error, wonder if this has to do with a particular thread which is timed out by the database whereas the Appserver thinks thats still valid & tries using the same thread & Boom !
                • 5. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
                  843854
                  we get exactly that error every morning, using Oracle thin driver. we even disconnect and reconnect to the database frequently. Did anyone solve the problem up to know?
                  • 6. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                    843854
                    java.sql.SQLException: E/A-Exception: Connection reset by peer: socket write error
                    Look on the Oracle server for any .TRC files in the udump directory. You will also see this when the Oracle worker process crashes (as happens occasionally :-).
                    • 7. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                      416044
                      Hello Martin. This post is not related to this topic but I came by one of your old posts from last year and was wondering if you ever got the problem resolved.
                      ##############
                      ORACLE driver: timeout => Connection reset by peer: socket write error ?
                      Author: MartinHilpert Oct 11, 2002 2:57 AM

                      I have the latest ORACLE JDBC driver 9201 for JDK 1.3. My servlet (running in weblogic server) works good during the day. But every morning, when i first access the servlet, I get the following exception when the first database access occurs:

                      --------------
                      java.sql.SQLException: E/A-Exception: Connection reset by peer: socket write error
                      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
                      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
                      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
                      at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:417)
                      at oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:470)
                      at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:379)
                      at de.deka.bav.sql.DBManager.select(DBManager.java:205)
                      at de.deka.bav.sql.DBManager.getUserByLogin(DBManager.java:751)
                      at de.deka.bav.security.UserManager.checkLogin(Unknown Source)
                      at de.deka.bav.BavRequestBroker.processRequest(Unknown Source)
                      at de.icomps.servlet.RoutingServlet.processPost(Unknown Source)
                      at de.deka.bav.web.BavServlet.processPost(Unknown Source)
                      at de.icomps.servlet.ICServlet.doPost(Unknown Source)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                      at de.icomps.servlet.ICServlet.service(Unknown Source)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
                      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
                      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
                      at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
                      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
                      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
                      -------------------

                      after re-deploying my servlet it works again (until the next morning). what's the reason for this? in my code i check the database connection for isClosed() and == null to create a new connection if one of these checks returns true. but it doesn't help. Is there a kind of timeout in the ORACLE driver? and if so, how can i detect this?
                      #######################

                      I am having similar problems with my RSA Cleartrust deployement running on weblogic 7 sp4.

                      You can email me if you like at jaeh_kim@yahoo.com. Thanks in advance.

                      ********

                      Please don't reply in a completely other thread to a different topic!
                      The problem i had was not a problem of the driver. I noticed that our server disconnected every night due to backup procedures. i fixed this by checking my connection in a specific intervall (e.g. perform a simple select) and if it fails, i create a new connection.

                      • 8. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                        843854

                        But will that help. I use the getDatasourec().getConnection() of tomcat for getting connection. Evenif the connection is not open, we will know about it only when we execute the query .

                        I also faced the problem with tomcat Commons-DBCP.
                        • 9. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                          843854
                          For guys using DBCP, try setting its "testOnBorrow" property to true. Also set the "maxIdleTime" to a value lesser than the maximum idle time on the DB Server. We faced same problem with MySQL running with
                          default max idle time of 8 hours and clients loosing connections when coming back alive in the morning.

                          • 10. Re: ORACLE driver: timeout => Connection reset by peer: socket write error ?
                            843854
                            This is more a question than a reply...
                            we are encountering similar problems using an oracle thin connection from a Win2K application server JDK 1.3.1_02 and Macromedia Jrun3.1 .
                            The application we are running is an H24 non stop, therefore this error occurs more often than just at beginning of day.
                            The trend is :
                            several errors like
                            java.sql.SQLException: Eccezione IO: Connection reset by peer: JVM_recv in socket input stream read followed by some error like
                            SQLState: null ErrorCode: 17002 SQLException: java.sql.SQLException: Eccezione IO: Connection reset by peer: socket write error
                            Investigating the causes I think this can be done to one of the following:
                            1) Network failures originating what I like to call 'apparent death' of an oracle thin connection
                            2) Bugs in jdbc drivers (we are running 9.2.0 and are planning to patch upto 9.2.0.5 ) which could cause memory leak problems on oracle server side leading SQL*Net to a listener error.
                            Network connectivity loss problems can be solved by using a keep alive, but I don't know how to implement it and how to kill and re-initiate all thin connections in case of such a loss without stopping and restarting the entire application.
                            I think this kind of an error can happen using oci connections and in that case the error syntax is a ORA-03113: End of ile on communication channel... am I right?
                            Bye to all,
                            Marco
                            • 11. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                              843854

                              For guys using DBCP, try setting its "testOnBorrow"
                              property to true. Also set the "maxIdleTime" to a
                              value lesser than the maximum idle time on the DB
                              Server. We faced same problem with MySQL running with
                              default max idle time of 8 hours and clients loosing
                              connections when coming back alive in the morning.
                              This happens regularly when we stop/start our webapp on Tomcat frequently. Each time 4 connections are added, while the older are not released (only if the stop/start process is too short). After 12 cycles, all connections to Oracle are used, and we get a ConnectionError afterwards.

                              Is there a way to tell Tomcat to release all connections at webapp shutdown-time ???
                              • 12. Re: ORACLE driver: timeout => Connection reset by peer: socket write error
                                843854
                                Hello.

                                Certainly smells like an Oracle bug to me. I've been having the same issue running:

                                * WebLogic 8.1
                                * JVM 1.4.1_03-b02
                                * Oracle Thin Driver 8.1.7

                                Has anyone reported this to Oracle yet?

                                Thanks.
                                • 13. java.sql.SQLException: Exception d'E/S: Software caused connection abort: s
                                  843859
                                  The application connect (using jdbc driver) to 2 differents databases servers
                                  I have 2 problems or exceptions in the same time ?
                                  the first is cosed by this exception:

                                  java.sql.SQLException: Il n'y a plus de donn�es � lire dans le socket
                                       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
                                       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
                                       at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
                                       at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
                                       at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
                                       at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:369)
                                       at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
                                       at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:830)
                                       at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)
                                       at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
                                       at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:572)
                                       at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)

                                  and the second is cosed by this exception :

                                  java.sql.SQLException: Exception d'E/S: Software caused connection abort: socket write error
                                       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
                                       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
                                       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
                                       at oracle.jdbc.driver.OracleConnection.commit(OracleConnection.java:1345)
                                       at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:238)
                                       at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:199)

                                  My question is :
                                  it is a network problem? and what can I do ?
                                  • 14. Re: java.sql.SQLException: Exception d'E/S: Software caused connection abor
                                    843859
                                    Hi All,

                                    I have similar problem. I set the validationQuery property and it works in case of - database restart or
                                    - connection broken and reestablish.

                                    Hope this helps.
                                    1 2 Previous Next