JDBC 4.J - Connection reset

Hi,
I have problem with JDBC(4.1) cennection to MS SQL 2012. I have java application which is running in loop and contacting sql server. Java program works for few minutes(max 4hours) and then going to down with error message:
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerC
onnection.java:1668)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerC
onnection.java:1655)
        at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1789)
        at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:4881)
        at com.microsoft.sqlserver.jdbc.TDSReader.nextPacket(IOBuffer.java:4791)
        at com.microsoft.sqlserver.jdbc.TDSReader.ensurePayload(IOBuffer.java:47
67)
        at com.microsoft.sqlserver.jdbc.TDSReader.readUnsignedByte(IOBuffer.java
:4970)
        at com.microsoft.sqlserver.jdbc.SQLServerResultSet.initializeNullCompres
sedColumns(SQLServerResultSet.java:711)
        at com.microsoft.sqlserver.jdbc.SQLServerResultSet.discardCurrentRow(SQL
ServerResultSet.java:1709)
        at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLSe
rverResultSet.java:1774)
        at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultS
et.java:1034)
        at javaapplication1.JavaApplication1.main(JavaApplication1.java:79)
Anybody idea?
Thanks
Tom

Hi Eric,
thank you for the answer. I tried JDBC 4.0, 4.1 and our supplier works with JTDS. Both have the same result with connection reset exception. If I put query with few records(tens of record), it is work fine. But If I put query on table with 1000 - 1 000 000
recods, the loop is gooing to Exception (connection reset), sometimes it work few minutes sometimes it works for few hours.
Tom
code here:
public class JavaApplication1 {
    public static void main(String[] args) {
        String url = "jdbc:sqlserver://X.X.X.X\\ITSQL:1433;databaseName=Alvao;autoReconnect=true";
        Statement stmt = null;
        ResultSet result = null;
        String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        String databaseUserName = "USER";
        String databasePassword = "PSWD";
        try {
           while(true){
            String col1, col2, col3;
            Class.forName(driver);
            conn = DriverManager.getConnection(url, databaseUserName, databasePassword);
            long startTime = System.currentTimeMillis();
            stmt = conn.createStatement();
            result = null;
            result = stmt.executeQuery("SELECT SYSDATETIME()");
            result.next();
            String serverTime = result.getString(1);
            System.out.println(serverTime);
            result = stmt.executeQuery("SELECT Convert(nvarchar(20), PK_USER_ID) +'_'+ Convert(nvarchar(20), PersonalId) +'_'+ Convert(nvarchar(20), Employment) as ret  FROM [Alvao].[nova_idm_export].[Person]
where PersonalId = '710804'");
            result.next();
            String result1 = result.getString(1);
            System.out.println(result1);
            result = stmt.executeQuery("SELECT count(*) celkem FROM [Alvao].[nova_idm_import].[tImportPerson]");
            result.next();
            String result2 = result.getString(1);
            System.out.println(result2);
            stmt.setQueryTimeout(30000);
// This table returns > 1 000 000 records. If I skip this query, the lopp newer crashes
            result = stmt.executeQuery("SELECT * FROM [Alvao].[dbo].[tblLog]");
            result.setFetchSize(10000);
            int counter = 0;
            while(result.next()){
             counter++;
            String result3 = Integer.toString(counter);
            System.out.println(result3);
            conn.close();
            long estimatedTime = System.currentTimeMillis() - startTime;
            System.out.println(estimatedTime);
            System.out.println("---------------");
            BufferedWriter bw = new BufferedWriter(new FileWriter("soubor.txt", true));
            bw.write(serverTime+" "+result1+" "+result2+" "+estimatedTime);
            bw.newLine();
            bw.flush();
Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
            try{
            BufferedWriter bw = new BufferedWriter(new FileWriter("souborChyb.txt", true));
            bw.write(e.getMessage());
            bw.newLine();
            bw.flush();
            }catch(IOException ex){

Similar Messages

  • JDBC Receiver Channel Connection Reset:

    Dear Team,
    I am facing Problem in JDBC Synchronous Receiver Channel.
    when ever the JDBC Channel (Synchronous Receiver) is executing i am getting JDBC Conenction reset error in the Channel monitoring.
    Why this problem is coming and how to rectify the problem?
    In production also we are facing same kind of issue. Please help us find a work around for this Problem.
    I have checked the link
    [Re: JDBC Channel : Connection reset;
    but the link which Siv Marani has mentioned in the above forum doesn't exist any more i guess.
    Please Advice.
    Regards,
    Senthilprakash.
    Edited by: senthilprakash selvaraj on Jan 28, 2009 4:34 AM

    Hi,
    Check below links.
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D44%26threadID%3D38124
    U need to add the parameter SelectMethod=cursor in your connection parameter,
    jdbc:microsoft:sqlserver://<hostname>:1433;DatabaseName=<dbname>;SelectMethod=cursor
    Regards,
    phani

  • 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).

  • Connection reset using JDBC Oracle thin Driver (towards 10g DB)

    Hi we have a home-grown application and a Oracle 10g (10.2.0.1) database.
    We created a scheduled servlet that gets a JDBC connection from a persistent connected cache (an OracleDataSource object registered using OracleConnectionCacheManager). The servlet runs every 15 minutes and runs the query "SELECT SYSTIME FROM DUAL" on 10g Database as XYZ user. The datapool was created yday on web-app and all queries ran successfully for about 5 hours after which it reported a connection reset error.
    I can then conclude that we cannot keep the server session alive for the JDBC client by running frequent SQL queries.
    We didnt get any messages on the DB server side that indicate the release of the session
    Ultimately, we are struggling with reset connections from our applications that are
    using the JDBC thin oracle driver; after a couple of hours of idle
    connections, we receive the below error from the JDBC driver:
    Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError throwSqlException
    WARNING: DatabaseError.throwSqlException(e): Unable to find ORA number from
    exception Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError
    findMessage
    WARNING: DatabaseError.findMessage(errNum, obj): returned Io exception:
    Connection reset Jul 5, 2007 10:59:53 AM
    oracle.jdbc.driver.PhysicalConnection getWarnings
    INFO: PhysicalConnection.getWarnings()
    Any suggestions please ?
    Vk

    The code itself is fine; the problem is with one of:
    1) the connection URL
    2) intermediate networking
    3) the database itself
    1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
    - is Oracle really running on the default port, 1521
    - is the installation SID really "orcl"
    2) lots of possibilities, but only a couple are likely
    - is TCP/IP configured and running on your host
    - is there a persoanl firewall rpduct running? perhaps it's blocking the connection
    3) Is Oracle running?
    Is the listener running?

  • Destroying connection that is not valid, due to the following exception [com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset]

    Hi everyone, 
    I'm facing the following problem in a Server runing Linux with JBoss AS 4.2.2, JRE 1.6, and MSSQL Server 2005 with JDBC 2.0 (sqljdbc4.jar).
    The thing is: on friday morning I started up the server and everything worked fine ... next, from Friday at 6pm to Saturday at 8am nobody has used the system. 
    Then on Saturday at 8:05 got the following warning lines every time I tried to do something in my application. While it seems that everything works, after a few days the system starts to decrease their performance and malfunction, so I want to know why it
    might happen these warnings.
    I have tried to find a solution to this problem in several places but I'm not succeeding. That's why I'm writing my problem here... 
    Hope somebody can help me!
    Thanks in advance and best regards!
    Cristian.
    This is the "error" log.
    2011-06-11 08:05:29,680 WARN [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Destroying connection that is not valid, due to the following exception: ConnectionID:2941
    com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1339)
    at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1654)
    at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:3694)
    at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:5022)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:773)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:649)
    at org.jboss.resource.adapter.jdbc.CheckValidConnectionSQL.isValidConnection(CheckValidConnectionSQL.java:58)
    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:435)
    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:231)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:200)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:211)
    at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:538)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
    at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
    at org.hibernate.loader.Loader.doQuery(Loader.java:673)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2220)
    And this is my mssql-ds.xml
    <local-tx-datasource>
    <jndi-name>jdbc/bpmsdb</jndi-name>
    <connection-url>jdbc:sqlserver://ipaddress:1433;DatabaseName=BPMS</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <user-name>user</user-name>
    <password>pwd</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>50</max-pool-size>
    <exception-sorter-class-name>
    org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
    </exception-sorter-class-name>
    <metadata>
    <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    <new-connection-sql>select 1</new-connection-sql>
    <check-valid-connection-sql>select 1</check-valid-connection-sql>
    <idle-timeout-minutes>5</idle-timeout-minutes>
    </local-tx-datasource>

    I´m facing similar problem with Linux and SQL Server 2008 R2. I made the downgrade of JDK 1.6 from 27 to 26 (some people reporting errors when upgraded to jdk1.6_29 and rolling back is ok) but for me the error persists. At this moment we are testing with
    sqljdbc4.jar version 4.0 (released in 3/6/2012). The curious I have two equals Linux boxes and only one have presented connection reset errors.
    Thanks in advance.
    Carlos

  • JDBC Connection Reset when using many processes on 64 bit system

    Hi,
    we've a annoying JDBC connection problem since we migrated our Java server to a 64 bit operating system. Here our environment.
    Database Machine:
    Oracle 10g
    Linux 32 Bit (but same problem on 64 Bit)
    Application Servers Machine:
    JDBC driver 11.1.0.6
    SUN Java 1.6.0_06 64bit
    Linux 64 bit (SLES 10 SP2)
    We have 6 different Java server processes (but with the same code) which all create some connections to the same database (running on a different Hardware). All 6 Java server processes starting at the same time (via scripts).
    Everything was fine, until we migrated the application server machine from 32 bit Linux to 64 bit Linux. From this day on, the half (or one more or less) of our application server processes can't longer connect to the database. The application server processes which have the problem product the following stack trace:
    java.sql.SQLRecoverableException: I/O Exception: Connection reset
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:281)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:118)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:296)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:611)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:455)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:494)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:199)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:154)
    at com.aaaa.utils.db.DbConnectionPool.<init>(DbConnectionPool.java:130)
    It looks like a network problem with the system but all other network stuff works without problems, between the two machines.
    - We use the thin JDBC driver (no OCI)
    - No firewalls are active on both systems
    - Both systems are in the same subnet connected to the same switch
    - The DNS configuration on both systems are ok (forward and reverse)
    - We've found the same problem on different application-server/database-server pairs with 64 bit application server hardware - but not all of our 64 bit server systems have this problem.
    - When running application server process and database on the same system (connecting via localhost) the problem does not longer appear.
    - The same database machine connected from a 32 bit application server (with 6 different java processes starting at the same time) works without a problem.
    We've tried a lot of things to isolate the problem - but with no success.
    - Same problem with SUN Java 1.6.0_06 32 bit (on 64 bit Linux)
    - Same problem with SUN Java 1.6.0_15 (32 and 64 bit)
    - Played with some JDBC connection properties (oracle.jdbc.TcpNoDelay, oracle.jdbc.ReadTimeout, oracle.net.CONNECT_TIMEOUT, oracle.net.disableOob, oracle.jdbc.RetainV9LongBindBehavior, oracle.jdbc.StreamChunkSize) without a positive result.
    - We've updated Linux network driver
    - We've changed to an completeky other NIC
    - We've tried an other Linux 64 distribution
    - We've increased the PROCESSES parameter in the init.ora
    - We've tried the JDBC driver 11.1.0.6
    - We've tried the _g version of the JDBC driver, but the debugging output simply tell us "Connection Reset" without a hint why.
    - We've tried a more complex JDBC connect string (
    "jdbc:oracle:thin:@(DESCRIPTION=" +
    "(ADDRESS_LIST=" +
    "(ADDRESS=(PROTOCOL=TCP)" +
    "(HOST=host)" + =
    "(PORT=port)" +
    ")" +
    ")" +
    "(CONNECT_DATA=" +
    "(SERVICE_NAME=sid)" +
    "(SERVER=DEDICATED)" +
    ")" +
    Nothing of this things helped us to isolate the problem.
    When we start our application server processes with a long pause (>1 min) between every process start. The problem does not occure. When we start only one application server with the same number of connections as the 6 different application server processes, everything works fine.
    We have absolute no idea why
    - this only occures on 64 bit Linux
    - independent if it's a 32 bit or 64 bit JVM
    - does not occure on all 64 bit application server machines / database machine pairs
    - never occure on the same 64 bit app server hardware when using a 32 bit Linux
    - using the Oracle JDBC 10g driver (10.xxx) there is no problem (but because of other issues, we need to use the JDBC 11g driver)
    Does anybody has an idea what our problem is?
    Thanks in advance,
    greetings

    I was recently struggling with this exact same problem. I opened a ticket with Oracle and this is what they told me.
    java.security.SecureRandom is a standard API provided by sun. Among various methods offered by this class void
    nextBytes(byte[])
    is one. This method is used for generating random bytes. Oracle 11g JDBC drivers use this API to generate random number during
    login. Users using Linux have been encountering SQLException("Io exception: Connection
    reset").
    The problem is two fold
    1. The JVM tries to list all the files in the /tmp (or alternate tmp directory set by -Djava.io.tmpdir) when
    SecureRandom.nextBytes(byte[]) is invoked. If the number of files is large the
    method takes a long time
    to respond and hence cause the server to timeout
    2. The method void nextBytes(byte[]) uses /dev/random on Linux and on some machines which lack the random
    number generating hardware the operation slows down to the extent of bringing the whole login process to
    a halt. Ultimately the the user encounters SQLException("Io exception:
    Connection reset")
    Users upgrading to 11g can encounter this issue if the underlying OS is Linux which is running on a faulty hardware.
    Cause
    The cause of this has not yet been determined exactly. It could either be a problem in
    your hardware or the fact
    that for some reason the software cannot read from dev/random
    Solution
    Change the setup for your application, so you add the next parameter to the java command:
    -Djava.security.egd=file:/dev/../dev/urandom
    We made this change in our java.security file and it has gotten rid of the error.

  • 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" 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.

  • CF 10 getting random resets : Detail: [Macromedia][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset).

      These resets appear to coincide with a clearing of the cached queries for the DSN from memory, breaking all my sub queries that try to use the initial cached one.  I am grasping at straws to discover the reset culprit, the DSN tests always show OK, there is not packet loss at the switch level.  If anyone has some suggestions, I am all ears!
      The resets are completely random and under no load.  My sql 2008 r2 box is set to unlimited connections.
    An example of a DSN setup is :
    Maintain Connections [x]
    String Format [ ]
    Max Pooled Statements 100
    Timeout 20 Interval 7
    Query Timeout 0
    Login Timeout 30
    CLOB [ ]
    BLOB [ ]
    Long Text Buffer 64000
    Blob Buffer 64000
    Validate Connection [ ]
    I am running the following :
    CF Enterprise 10,0,13,287689
    Tomcat 7.0.23.0
    Ubuntu 1204 x64
    Java VM 20.4-b02
    Java 1.6 (Sun Microsystems Inc)
      I have seen it suggested to uncheck the maintain connections advanced options but this doesn't seem like a good approach to the problem and will cause more stress on the sql box IMHO.
      I have also seen it suggested to enable Validate Connection but documentation on this is a bit sparse...
    Here are more examples of the initial reset error and then the subsequent cache related errors :
    Database Error Information:
    Native Error Code: 0
    SQL State: 08S01
    Query Error: [Macromedia][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections have not been exceeded for this server.
    Custom Error Code: 08S01
    Database Error Information:
    Native Error Code: 0
    SQL State: n/a
    Query Error:
    Query Of Queries runtime error.
    Table named GlobalDetails was not found in memory. The name is misspelled or the table is not defined.
    Custom Error Code: n/a
    Thanks in advance to anyone who has a suggestion.

    Hi, could DBA check MS SQL Server connection logs???
    May be server has some limits (for example sessions, memory and e.t.c.)

  • 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.

  • Connection Reset issue in Weblogic 8.1

    Hi,
    We have an application running on weblogic 8.1. Please let men explain the steps that we carried out:
    1. A new user was being enrolled through the applciation.
    2. To make the connection object the value of the properties DriverClass, ConnectionURL, UserId and Password was obtained from the config.xml.
    3. preparedStatement.executeUpdate() inserted data in the database.
    This works fine initially but when i leave the system idle for an hour or so and then try to access the application we get an error:
    java.sql.SQLException: Io exception: Connection reset
    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:334)
    at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3675)
    at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:618)
    at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:575)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2803)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
    at workout.security.weblogic.realm.rdbms.RDBMSDelegate.addGroupMember(RDBMSDelegate.java:757)
    at workout.security.weblogic.realm.rdbms.RDBMSRealm.addGroupMember(RDBMSRealm.java:446)
    at workout.security.weblogic.RDBMSSecurityRealm.add(RDBMSSecurityRealm.java:84)
    at workout.util.LDAPClientHelper.add(LDAPClientHelper.java:39)
    at workout.ejb.Enrollment.EnrollmentBean.enroll(Unknown Source)
    at workout.ejb.Enrollment.Enrollment_q1qync_EOImpl.enroll(Enrollment_q1qync_EOImpl.java:206)
    at workout.ejb.Enrollment.Enrollment_q1qync_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
    at workout.ejb.Enrollment.Enrollment_q1qync_EOImpl_812_WLStub.enroll(Unknown Source)
    at workout.beans.UserProfile.enroll(Unknown Source)
    at jsp_servlet._customer_service._consumer_enrollment.___processall._jspService(___processall.java:1524)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    After some more attempts the system appears to work fine.
    If anyone can advise then it will be of great help.
    Thanks & Regards
    Neeraj Kanodia

    For those interested, I have some updates on this subject and someone out there sent me a mail asking if I ever found anything out.
    Basically, when I encountered this issue the first time, I was working on a SP2 Portal. We were having numerous small bugs like this one with SP2 that centered around the back button or refresh button. BEA gave us a "super patch" back in July or so that when applied to our SP2 project, fixed our issue. I have sense moved onto SP3, and I did not see the compression issue (so I think SP3 must have the patches correctly setup...like I would assume it would).

  • Error processing request in sax parser...Excepciu00F3n de E/S: Connection reset

    Hello,
    I've RFC to JDBC interface.
    Sometimes in the RWB me the following error message,
    <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LISMATWQ' (structure 'STATEMENT'): java.sql.SQLException: Excepción de E/S: Connection reset</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace="" />
    How can I prevent?
    Thanks very much,

    Hello,
    the error does not always appear, sometimes the interface works well and others do not (even when the data are the same) I find no solution to this error,
    anyone have any idea?
    thanks very much

  • Connection Reset Hangs WebLogic

    We are using WLS 6.1 Sp2 and Oracle 8.1.7 and sometimes we get a "Connection Reset
    by Peer" error from the database that hangs the WebLogic. Does anybody know if
    there is anything to prevent at leaset WebLogic from hanging?
    Thanks,
    -Jalil

    Jalil wrote:
    We are using WLS 6.1 Sp2 and Oracle 8.1.7 and sometimes we get a "Connection Reset
    by Peer" error from the database that hangs the WebLogic. Does anybody know if
    there is anything to prevent at leaset WebLogic from hanging?
    Thanks,
    -JalilThat means the DBMS or network has dropped the connection from the driver.
    Which JDBC driver are you using? If it's a type-2 driver like ours (uses DBMS-
    supplied native code for connectivity), sometimes the native code will hang,
    and the JVM can't do anything with that thread. I recommend you try using
    Oracle's latest thin (all Java) driver.
    Joe

  • Connection reset exception

    I am getting the below exception in my weblogic logs
    [FMWGEN][SQLServer JDBC Driver]socket write error: Connection reset by peer.
    java.sql.SQLNonTransientConnectionException: [FMWGEN][SQLServer JDBC Driver]socket write error: Connection reset by peer.
         at weblogic.jdbc.sqlserverbase.dda4.b(Unknown Source)
         at weblogic.jdbc.sqlserverbase.dda4.a(Unknown Source)
         at weblogic.jdbc.sqlserverbase.dda3.b(Unknown Source)
         at weblogic.jdbc.sqlserverbase.dda3.a(Unknown Source)
         at weblogic.jdbc.sqlserverbase.dda3.a(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.ddb.a(Unknown Source)
         at weblogic.jdbc.sqlserver.ddj.a(Unknown Source)
         at weblogic.jdbc.sqlserverbase.ddde.a(Unknown Source)
         at weblogic.jdbc.sqlserverbase.ddde.a(Unknown Source)
         at weblogic.jdbc.sqlserverbase.ddde.r(Unknown Source)
         at weblogic.jdbc.sqlserverbase.ddde.execute(Unknown Source)
         at gov.fssa.bcd.utils.JDBCConnection.runQuery(JDBCConnection.java:366)
         at gov.fssa.bcd.utils.JDBCConnection.runQuery(JDBCConnection.java:492)
         at gov.fssa.bcd.utils.JDBCConnection.runQuery(JDBCConnection.java:428)
    This exception happens randomly on production.
    I am not sure is it a problem with Weblogic 10.3.5 or my database server or the java app or network related.
    Can anyone please help me to conclude which side of the appplication is at fault.
    I am using Java 1.6.0_27,Weblogic 10.3.5, sql server 2005
    Weblogic is on a Windows server 2008 sp2 and database is on windows server 2003.
    Is it because of Java coding or some network related?In what scenarios will a java program throw such errors.
    Let me know if any more info is required .
    Thanks,

    "Failing Client" means the application you are using to connect fails unexpectedly. It is a failure of the application you are using to run the process.
    you can check the Managed Server logs for more detail of what is happening.
    Edited by: HDeiby on 4/10/2012 04:25 PM

  • 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.

Maybe you are looking for

  • How do I sync my iphone to a different itunes account?

    My whole family has been using the same itunes account for years now, but because of the recent updates we are receving eachother's imessages. We literally have all went in the message settings and changed the options for just our own phone numbers b

  • Running an Intel Mac on a Wireless Network with other Power PC Macs

    I know changing the Airport to WPA encryption will allow an intel Mac with either Mac OS or WinXP OS to access the airport. If you have powerPC Macs also, what encryption will allow both Mac (intel and powerPC) and WinXP to access the airport? Right

  • Bluetooth Fried?

    I have a somewhat unique situation. I don't get to travel as much as I used to, so I am mainly using my PowerBook as a desktop computer, connected to an external display, mouse, keyboard, cooling pad, the whole bit. I also removed the battery, so it

  • How to get attributes of the XML header?

    Hallo! Does anybody know peraps, what is the Xpath expression to receive header attribute from XML file? I mean p.e. there is "<?xml version="1.0" encoding="ISO-8859-1"?> (...) and so on, I need to get           version = "1.0"              they are

  • [SOLVED] Can't update because of xmonad dependencies

    I noticed some trouble I've been having with xmobar and xmonad, so I figured I would try making sure everything is up to date before I did anything else, since that often solves problems. But when I try to run pacman -Syu or yaourt -Syu, it halts bec