Conecting to mysql database Connection reset by peer

hi guys,
I have to connec to sever where , from this place i need to contact a remote database , the databse is behind a firewall , they database in their intranet ,they have give me a valid ip , they have a conection between the valid ip and the intranet system , they give me access to the port in the fire wall , i asked for the port 3306 (mysql default ) port , and tried connecting it but i get exception, should i need to get the 80 port for connection??? please help
java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: Connection reset by peer: Connection reset by peer ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Connection reset by peer: Connection reset by peer STACKTRACE: java.net.SocketException: Connection reset by peer: Connection reset by peer at java.net.SocketInputStream.socketRead(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:86) at java.io.BufferedInputStream.fill(BufferedInputStream.java:186) at java.io.BufferedInputStream.read1(BufferedInputStream.java:225) at java.io.BufferedInputStream.read(BufferedInputStream.java:280) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1391) at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1413) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:625) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1782) at com.mysql.jdbc.Connection.(Connection.java:450) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:199) at org.apache.jsp.store$jsp._jspService(store$jsp.java:107) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java: 201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.jav a:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:17 4) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551) at java.lang.Thread.run(Thread.java:484) ** END NESTED EXCEPTION **

yeahman i feel the same, but i need to prove them they need to do some work , for that i should show thm its not my problem , can u tell me how the jdbc connector works,or any other way telling them , the port not opened still , how will the server pass the request to the database , some one please help me

Similar Messages

  • "Connection reset by peer" using firewall between iFS API and Database

    Hi ..
    We have a webapplication running on a websphere server using the iFS API to connect to a iFS schema through a firewall ( PIX ). The firewall will close idle connections after a while, and this results in "Connection reset by peer" errors in our application.
    Firewall guys says that configuring the firewall not to close connections, is not an option.
    Does anybody have experiences with this, suggestions on how to deal with this?
    We are running iFS 9.0.1.
    Thanks
    Anders Monrad
    Danisco IT

    I'm having the same problem, using a PIX firewall, however, I have the firewall setup between OHS & OC4J, also between OC4J and our application database.
    I have a solution for the OC4J and app DB. If I set the expire_time = 10 in sqlnet.ora, this will ensure that sqlnet will ping the connection between OC4j and the DB every 10 minutes, thus the firewall will not close the connection due to inactivity.
    However, does anyone have a solution for the OHS & OC4J connection? Can this be resolved with configuration rather than having to use an app to ping it?
    [I realise I could write an app to retrieve a page every so often to keep the connection open, but I want to do it with configuration]
    Thanks in Advance.

  • Socket read error: connection reset by peer

    Hi.
    Has anybody experienced the error message �Socket read error: connection reset by peer�
    Please see below for detailed information.
    Appreciate your help
    Regards
    RT
    Enviroment specification
    Server: HP/UX 11.00 64-bit, Oracle RDBMS 8.1.6.0.0 64-bit
    2 firewalls between client and db.
    Client:
    Win 2000,
    SP3,
    Oracle Client 8.1.7.0.0 ,JDBC OCI (thin JDBC driver,class12.zip)
    JDK 1.3
    JRUN3.0
    The TCP protocol is being used in the communication
    Error messages
    Web Users receive:           Socket read error: connection reset by peer
    Trace files on the sever:      Read unexpected EOF ERROR on 18.
    Explanation: The error in the server sqlnet trace file, suggests that a client connection has terminated abnormally, i.e. client machine powered off, a cable removed or a network connection aborted without warning. No user has complained of such a problem and there is no client trace with an error.
    The problem
    The users of the java web application, experiencing an exception almost once or twice a day.
    The JRUN web-server reports broken connections to the db and client are receiving "connection reset by peer".
    At the moment when the errors occurs the users just have to wait a while(2-10 min) and then they can use the web application again.(no action is taken)
    This problem can not be reproduced. The problem happens only occasionally when the network is under heavy load and new DB connection is being created.
    The application
    The java web-application uses a customized connection pooling against the database. This pool is shared among all the users of the website. whenever a user process needs to fetch data from the database, a free connection from this pool is allocated. The application is testing if the connection is valid before making a transaction (select '1' from dual). When the error occurs a ORA-3113 end-of-file on communication channel is returned to the application.
    The path between the client and db involves at least two firewalls. The firewalls are opened for sql*net traffic. The network group can tell that enquiries from the app.server is not getting feedback from the db. They have not however, identified if the enquiries are reaching the db-srever, or if they are stopped earlier in the network.
    Around 1000 users, are using other applications which uses dedicated sqlnet connections against the db and they have not experienced any problems.
    Issues considered
    Connection pooling
    It is a customized connection pooling, developed by Lindorff developers.
    I have read through the source code for the connection pooling and it does the job as it should, and in case of bad connection, it tries to create a new connection.
    The log file shows that the call to the method DriverManager.getConnection() hangs until the server goes down, which is probably because of the fact that the method DriverManager.setLoginTimeout(), does not take effect and timeout value is Zero. ( According to oracle , Oracle JDBC does not support login timeouts and calling the static DriverManager.setLoginTimeout() method will have no effect).
    Firewall
    One thing to consider is when the firewall may decide to shut down the socket due to long inactivity of a connection. This will cause problems to JDBC Connection Pool because the pool is not aware of this disconnection at the TCP/IP level; until someone checks out the connection from the pool and tries to use it. The user will get a Socket read error: connection reset by peer.
    Jrun timeout paramter is less than the firewall�s timeout so the firewall will not close a connection before Jrun does.
    Number of processes the DB can handle
    Processes parameter is 1300, , they have not experienced the Oracle error msg �max # of processes reached�.
    Port redirection through a firewall:
    Since the firewall has a sql net proxy Port redirection through a firewall is not a problem. Problems with port redirection only appear at connect time, but in this situation the connections fail long after the connection is established.
    The network group
    The network people who investigaged the problem at Lindorff report that there are a significant amount of "dropped packages" between the database server and the jdbc client (web-application) 24 hrs. The reason for this is "unknown established TCP packet" which means that the firewall does not consider these packages to be part of an already established session. The network group believes this happen because one of the hosts send a RESET or FIN signal which the firewall have noticed but are not received by the other host.
    It seems like the firewall are dropping packages bacause of "Unknown
    established TCP packet" from both the JDBC client and the TNSLISTENER on the database server. The dropped packages are SQL*Net v2 traffic so clearly Oracle products are involved

    Presumably something is working.
    Thus the problem is not with your code. At least not the database part that you have control over.
    That error occurs when the other side closes the socket. Presumably you are catching lost connection exceptions and trying to restore it.

  • JDBC Connection reset by peer: JVM_recv in socket input stream read

    Hey Guys,
    Has anyone seen this issue? We get this error in our Weblogic app logs at times and no one is able to login to our application. Our database server and SQL server seem fine at a high level. Any ideas what is causing this?
    com.s1.arch.persistence.exception.PersistenceException weblogic.jdbc.mssqlserver4.TdsException: I/O exception while talking to the server, java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
    Thanks

    please make sure that there is no Firewall between your servers and DB server. this message usually happen when there is a fire wall between the servers. if yes please make sure that the connection time on fire wall is longer than the time needed to complete an operation another thing that you need to check if you have a fire wall which is to make sure that Oracle DBMS return the request to the same port that it is listening to (1521 default).

  • Io exception: Connection reset by peer: JVM_recv in socket input stream read

    We are developing a new J2EE app using JDev, OC4J, servlets, and EJBs. We have determined that our firewall is closing database connections that have been idle for 1 hour. This is a security requirement that cannot be changed. When we try to use these idle connections in both stateless and entity beans, we consistently receive this or a similar error message:
    "ServletSACategoryList: Error invoking EJB procedure. Exception: java.sql.SQLException: StatelessSysAdminBean::getCategoryList - Io exception: Connection reset by peer: JVM_recv in socket input stream read "
    Environment:
    Oracle 9iAS 9.0.2.0.0
    Database: Oracle 8.1.7
    JDBC 8.1.7
    JDK 1.3
    JDev 9.0.2.829
    We are using the ejb-location attribute within data-sources.xml for JNDI lookup of the DataSource. Here is what this file looks like:
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleDataSource"
    name="jdbc/OracleDS"
    location="jdbc/OracleCoreDS"
    xa-location="jdbc/xa/OracleXADS"
    ejb-location="jdbc/OraclePoolDS"
    url="jdbc:oracle:thin:@###.###.#.###:1521:dev1"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="????????"
    password="????????"
    max-connections="4"
    wait-timeout="20"
    min-connections="1"
    inactivity-timeout="60"
    connection-retry-interval="1"
    max-connect-attempts="3"
    />
    </data-sources>
    After calling getConnection() on the Connection object in my stateless bean, I have tried checking if the Connection object is null or isClosed(), I have caught any Exception, and looped to try again, but nothing has worked.
    Please respond to [email protected] or directly to this post if you can help in any way.
    Thank you,
    - Rob

    Hi Robert,
    If you don't mind, I can only offer a few suggestions for things
    to try -- I'm afraid I don't have a solution for you. Of-course,
    you may have already tried these things, so please excuse me if
    this is the case.
    Firstly, your "data-sources.xml" file looks "different". Have
    you read the "Data Sources" chapter of the "Oracle9iAS Containers
    for J2EE Services Guide, Release 2 (9.0.2)"? It is accessible
    from here:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95879/ds.htm#1004903
    Also, have you tried running OC4J in "debug" mode? This web
    page has more details:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    I get the impression from the information you have supplied,
    that you may not be explicitly closing your database connections
    in your code. It looks to me like you are obtaining a database
    connection in your session bean, and then keeping it for the
    lifetime of that bean. Is that correct? I think it's better
    to obtain a connection when you need to interact with the database,
    and then close the connection immediately after completing the
    interaction with the database (but that's just my opinion).
    Lastly, if you haven't already discovered them, these web sites
    may also be of help:
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.elephantwalker.com
    Hope this helps you.
    Good Luck,
    Avi.

  • Trying to insert a Large CLOB : connection reset by peer

    I am Trying to insert a Large CLOB .. i get this error message
    java.sql.SQLException: Io exception: connection reset by peer
    I am using a prepared statement to insert a Clob. It works fine with small data.
    Thanks for your help in advance.

    It might help if you gave more information - this probably depends on your database and driver, so giving info on them will help.

  • Javax.servlet.ServletException: Connection reset by peer....Help needed..

    Initially, when I clicked on my JSPs, everything was fine. I was able to retrieve data successfully from all the JSPs. However, after much clicking through the JSPs. I was not able to access the JSPs and the Internal Servlet Error was shown.
    Below is my Tomcat.log:
    Context log: path="/Aedge" Error in jsp service() : Connection reset by peer: socket write error
    javax.servlet.ServletException: Connection reset by peer: socket write error
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
         at org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:163)
         at org.apache.tomcat.servlets.DefaultServlet.doGet(DefaultServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
         at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
         at java.lang.Thread.run(Unknown Source)
    Context log: path="/Aedge" <b>Internal Servlet Error:</b><br>.....
    What is the problem here? How can I solve this as I had to restart my Tomcat once a while due to this problem.

    ok.. I have db classes where all my sql statements methods are being displayed.. In each db class, there will be a getInstance() method to create the connection. Below is one of my db class.. How to I modified the things you had mentioned in my codes..
    package aedgeSoft.access;
    import aedgeSoft.business.*;
    import java.sql.*;
    import java.util.*;
    import java.util.Date;
    import java.io.*;
    public class DBMemberType
         private Connection con;
         private static DBMemberType instance = null;
         public static DBMemberType getInstance()
              try
                   if(instance==null)
                        instance = new DBMemberType();
              catch(SQLException e)
                   System.out.println("Problems with loading database in DBMemberType");
              catch(ClassNotFoundException e)
                   System.out.println("Problems with loading db driver in DBMemberType");
              finally
                   return instance;
         private DBMemberType() throws SQLException, ClassNotFoundException
              try{
              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
              con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;user=username;password=password;DatabaseName=db");
              catch(InstantiationException e)
                   e.printStackTrace();
              catch(IllegalAccessException e)
                   e.printStackTrace();
         //add memberType
         public boolean addMemberType(MemberType mt)
    ..........

  • Broken Pipe/Connection Reset By Peer IO Exceptions

    Can someone explain what causes a connection reset by peer exception vs.
              a Broken Pipe IO exception? I realize they are generally caused by
              someone hitting stop, closing their browser, hitting a different link,
              etc.. but I was trying to understand what might cause a connection
              reset by peer exception vs. a broken pipe exception. I've added code to
              my servlet to suppress the "Connection Reset By Peer" socket exceptions
              but I'm wondering if I should do the same with Broken Pipe. Also, are
              there are other types of similar exceptions that can occur when users
              get impatient.. Thanks
              Kirk
              

    I do not have an idea about your application server but i do know how i solved it in weblogic. Just see whether this is helpful to you.
    Points to be sure of........
    1) Make sure that when ever you request a connection from a pool, after you are done with it return it. If you are not returning it and trying to use that reference again, this problem will occur.
    2) Look at the capabilities of your app server. Set the connection pool such that
    a) All the connections are checked at regular interval with some default select statement from any table in the database.
    b) Connections are check when the connection is checked out and returned to the pool.
    I the connection object is not ready , close it and create a new one. The app server which manages the pool should implement these feature so that when you get the connection - its the tested and working object.
    If your app server does not support - then think of ways you testing it before you using it(Anyway this is not the good solution).

  • Servlet error java.io.IOException: Connection reset by peer

    While opening the R12 Notifications, error with Internal Server Error. And find this in application.log
    Servlet error
    java.io.IOException: Connection reset by peer
         at sun.nio.ch.FileDispatcher.write0(Native Method)
         at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
         at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
         at sun.nio.ch.IOUtil.write(IOUtil.java:75)
         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
         at java.nio.channels.Channels.write(Channels.java:60)
         at java.nio.channels.Channels.access$000(Channels.java:47)
         at java.nio.channels.Channels$1.write(Channels.java:134)
         at com.evermind.server.http.AJPOutputStream.endRequest(AJPOutputStream.java:117)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:317)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Any idea ?????

    Hi,
    Please post the exact release of R12 along with the database version and OS.
    Is this issue with specific notification? If yes, please mention the steps to reproduce the issue.
    Was this working before? If yes, any changes have been done recently?
    Can you find any errors in the Workflow log file?
    Thanks,
    Hussein

  • Connection reset by peer:/Broken pipe using JTurbo JDBC Driver

    I am using the JTurbo JDBC driver to connect to a SQL Server 7.0 database. I am using Connection Pooling. After roughly an hour or so, I am no longer to get connections from the pool. Exceptions thrown are "connection reset by peer", followed by "Broken pipe" exceptions on every subsequent getConnection call.
    Has anyone found a successfull resolution to this problem using the JTurbo JDBC driver for SQL Server 7.0? I have tried the "autoReconnection=true" option on the URL string for the driver, but this has had no effect.
    I am running the Resin app server, version 1.2.7, on Solaris 8 and connecting to a SQL Server database running on NT 4.0. The JVM on Solaris where the servlet is running is 1.3.1.
    Any help is greatly appreciated!
    Mark Crouch
    Lead Developer
    accessKent

    I do not have an idea about your application server but i do know how i solved it in weblogic. Just see whether this is helpful to you.
    Points to be sure of........
    1) Make sure that when ever you request a connection from a pool, after you are done with it return it. If you are not returning it and trying to use that reference again, this problem will occur.
    2) Look at the capabilities of your app server. Set the connection pool such that
    a) All the connections are checked at regular interval with some default select statement from any table in the database.
    b) Connections are check when the connection is checked out and returned to the pool.
    I the connection object is not ready , close it and create a new one. The app server which manages the pool should implement these feature so that when you get the connection - its the tested and working object.
    If your app server does not support - then think of ways you testing it before you using it(Anyway this is not the good solution).

  • 'Connection reset by peer' and other punchlines - Help!

    I recently downloaded the latest version of the the JDBC driver and now the connection to the database drops within a few minutes with the exception "Connection reset by peer". The driver version is
    Version 8.0.5.2 JDBC(Thin) for NT. I am connecting to the 8.0.5 on a DEC Alpha machine.
    How does one keep the connection alive and prevent it from dropping so often. Why does the connection drop so quickly? Is there a setting on the database?
    Any help would be appreciated!
    With the older version of the driver the connection dropped intermittently after a few hours or even days with the exception:
    "No more data to read from socket". Subsequent attempts to reconnect within the code gave exceptions like:
    "Bigger type length than Maximum" and
    "Protocol violation"
    null

    This could be a number of things.  The DB could be killing sessions with something like a resource manager.  The network could be dropping. There could be an ora-600 that is aborting a connection.  Turn the debugging on by following this blog entry and let us know the results
    https://cdivilly.wordpress.com/2013/03/08/configuring-logging-in-oracle-application-express-listener-2-0-1/

  • Connection reset by peer issue

    Hello,
    Our application is occasionally getting messages like :
    weblogic java.net.SocketException: Connection reset by peer: JVM_recv
    in socket input stream read
    although it eventually recovers (we have the jdbc refreshTestMinutes
    set to 5). We are using Weblogic 5.1 Service Pack 12 and Jdk1.3.1_04
    connecting to SQL Server 2000 on another machine.
    After scratching our heads with what might be wrong with our
    application, we think it might be a network issue. Theres nothing in
    the SQL Server logs to indicate that there has been a problem on that
    side.
    Has anyone had this problem and resolved it, and if so how? Are we on
    the right track?
    Thanks,
    Caroline Sturtridge

    Thanks for those suggestions, we'll try them and see if they work.
    Strangely, I wrote a small program to keep a socket open between the
    two machines (completely separate from the main application) and we've
    not had a problem since...
    Z
    "Slava Imeshev" <[email protected]> wrote in message news:<[email protected]>...
    Hi Zeetha,
    "zeetha" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    Our application is occasionally getting messages like :
    weblogic java.net.SocketException: Connection reset by peer: JVM_recv
    in socket input stream read
    although it eventually recovers (we have the jdbc refreshTestMinutes
    set to 5). We are using Weblogic 5.1 Service Pack 12 and Jdk1.3.1_04
    connecting to SQL Server 2000 on another machine.
    After scratching our heads with what might be wrong with our
    application, we think it might be a network issue. Theres nothing in
    the SQL Server logs to indicate that there has been a problem on that
    side.
    Has anyone had this problem and resolved it, and if so how? Are we on
    the right track?It's definitely a network issue. I faced this kind of problem before.
    o You need to use test connections on reserve to true.
    o You need to talk to your network admin and find out
    if there are any firewalls/proxies between the app server
    and the database. They can be dropping connections
    after a period of incativity.
    o Ask the network admin to check error counters on the switch
    ports. Sometimes when the switch port is set to 100Mbit/Firm
    and other side use 100MBit/Auto, the parites can't negotiate
    speed and fall down to speed of 10th of kilobytes, having
    multiple errors etc. Cisco switches like doing this.
    Hope this helps.
    Regards,
    Slava Imeshev

  • Connection Reset by Peer Error

    I was working on an application at work and migrated the code and database to my machine at home so I can work on it there as well.
    It works fine on my work machine but when I run it at home it consistantly fails on the database connection statement with a "Connection Reset by Peer". I can connect to the database fine using the oracle tools so I know the database is up. I thought it was my firewall but I turned that off and the problem remains. I'm using the latest JDeveloper and an oracle 9i database and tried various JDBC drivers (classes12.zip..which is what I'm using at work, classes12.jar, and the newest drivers from the Javasoft site.) I also set it up using the forte IDE (thinking it may be a JDeveloper setting) but that didn't do it either.
    Any clues why this might be happening? I've been searching the internet for some insight but to no avail.
    Thanks
    Wendy

    Check the database's alert log. Are you using database links? Look into that.
    AS 9.0.2.3 is antique. It should have broken down already much earlier. Please move to a more stable version as soon as you can. You will not regret it.

  • "Connection reset by peer" exceptions in JDBC

    I wonder if someone from Oracle JDBC development can answer the issues raised in
    this posting.
    component: Oracle JDBC Thin Driver
    component version: 8.1.6
    rdbms version: 8.1.5.
    Summary of problem:
    A long running application that opens JDBC connections and holds them for the lifetime of the application gets SQLExceptions with a "connection reset" message when attempting to reuse a connection that has been idle for a long period of time.
    ( The exact period is not determinable from Oracle documentation).
    We need to handle this exception and open a new connection when this happens.
    The problem is how do we determine when this exception has happened when we
    catch a SQLException. Our software is internationalized and we cant interrogate
    the message text to match for "connection reset by peer".
    The ideal way to do this is for Oracle to throw a subclass of SQLException or to
    use a error code that is unique for the "connection reset by peer" case.
    The following is a summary of the items in this message
    1. Oracle should document when the software throws away open connections.
    2. Provide documented support for handling the above SQLException in
    a language independent manner.
    3. The method isClosed() on class Connection should return true once the
    connection is rendered unusable for whatever reason ( as per the JDBC specification).
    4. The Oracle JDBC drivers should include a retry mechanism on socket errors.
    ( We dont know that whether the connection is reset by the server or if the
    client just gives up once it gets any socket error).
    business need:
    long running applications have no documented way of detecting when a connection has been discarded by the Oracle Server.
    null

    The FAQ does not answer our problem as
    it is not a server problem. The
    support person for the Server group
    asked me to look through the Alrt.log file
    for the database and there were no entries
    for that time.
    Our application has multiple threads, each having its own connection to the database, some inactive threads seem to lose their database connection. We use a driver from a third-party vendor going against SQLServer in the same network and that does not fail in this manner.
    The above seems to rule out
    1. server problems ( no, the problem is not
    happening on the first connection, but
    after the connection has been in use for
    a long time).
    2. network problems. ( the other driver is
    functioning reliably ).
    I believe that the driver may be giving up
    fairly early in the retry process.
    The only way that we know to deal with the
    problem is as follows:
    1. when a SQLException is caught, we dont
    know that the connection has been reset.
    ( we dont want to interrograte the
    message string as it will not work
    in other language environments).
    2. we just ping the connection to the server
    ( use a simple call to set the transaction
    isolation level). If this fails, we
    assume that the connection has been reset. ( Of course, we would prefer a simpler
    way like checking whether the connection
    has been closed).
    Conclusions:
    1. We feel that connections should not be
    lost in this manner.
    2. The connection loss should be detectable
    in a much more reliable manner than the
    hack we use.

  • "Connection reset by peer"   Help Me

    Hi
    I have j2re1.4.2_08 and Oracle 9.2
    When I tried to update database with huge data I got following exception:
    java.sql.SQLException: Io exception: Connection reset by peer: 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.OracleStatement.executeNonQuery(OracleStatement.java:2061)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    at edu.bnmit.BookDBUpdateThread.run(BookDBUpdateThread.java:80)
    at edu.bnmit.BookDBUpdateThread.update(BookDBUpdateThread.java:46)
    at java.lang.Thread.run(null:-1)
    method used to update database is:
    void update(Books b[]){
    Connection dbConnection;
    PreparedStatement stmt;
    try{
    dbConnection = DriverManager.getConnection(
    dbConnection.setAutoCommit(false);
    String sqlStmt = "UPDATE Books SET " +
    "bookName=?, bookAuthor=?" +
    "WHERE bookId=?";
    stmt = dbConnection.prepareStatement(sqlStmt);
    for(int i = 0; i < b.length; i++){
    stmt.setString(1,b.bookName);
    stmt.setString(2,b.bookAuthor);
    stmt.setInt(3,b.bookId);
    stmt.executeUpdate();
    dbConnection.commit();
    stmt.close();
    dbConnection.close();
    }catch(SQLException e){
    System.err.println("Error While Updating Table");
    String s = e.toString();
    StackTraceElement trace[] = e.getStackTrace();
    for(int j = 0; j < trace.length; j++){
    s += "\n\tat "
    + trace[j].getClassName() + trace[j].getMethodName()
    + "(" + trace[j].getFileName()
    + ": " + trace[j].getLineNumber() + ")";
    System.err.println(s);
    }Orcale server is distently placed. I get this exception when I send 10,000+ records to update.
    Can anyone help me.
    Thanks

    [Just a note: the stack does not match the code posted here. In the stack, executeUpdate() is called from BookDBUpdateThread.run() whereas your code shows that it's called from BookDBUpdateThread.update().  It helps to post the correct stack/code.)
    The problem might just be that you have an unreliable connection. The fact that you have a long running operation is just exposing connection drops that may otherwise go unnoticed.
    I suggest that you test this over a more reliable connection. If that is not possible, split the update into multiple shorter running updates. Of course, this would only work if the updates do not require a single transaction. If a single transaction is required, you can use your own XATransaction (the details on XATransactions are beyond the scope of this forum.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for