java.net.SocketException: Connection reset

Discussion in 'Java' started by ilianaza@gmail.com, Jan 31, 2007.

  1. Guest

    Hi,

    We have recently switched from Oracle to MySQL and began experiencing
    similar problem with Weblogic 8.1 and MySQL 5.0.18. We get the
    following error message after 8 hours of inactivity:

    java.net.SocketException
    MESSAGE: Connection reset

    STACKTRACE:

    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:113)
    at
    com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java
    :113)
    at
    com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNece
    ssary(ReadAheadInputStream.java:160)
    at
    com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java
    :188)
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1910)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
    at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5215)
    at
    weblogic.jdbc.wrapper.PoolConnection.setAutoCommit(PoolConnection.java:
    136)

    We found out that MySQL's property "wait_timeout" was responsible for
    8 hour wait before this error occurred. It was set to "28800" seconds.
    We reset the value to 10 seconds that were able to replicate the error
    after 10 seconds of inactivity.

    The "wait_timeout" value is the number of seconds the server waits for
    activity on a non-interactive connection before closing it. This
    timeout applies only to TCP/IP and Unix socket file connections, not
    to connections made via named pipes, or shared memory.
    http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

    Setting this variable to some very large value seems like a work
    around and don't want to do that. We also tried to find similar
    variable on Weblogic's JDBC side, but could find any. Please let us
    know if someone was able to solve this problem without any work
    arounds.

    Thanks,

    Ilia
    , Jan 31, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ckumar
    Replies:
    4
    Views:
    41,942
    ckumar
    Feb 24, 2005
  2. bigBrother82

    SocketException: Connection reset

    bigBrother82, Nov 5, 2005, in forum: Java
    Replies:
    1
    Views:
    4,452
    Roedy Green
    Nov 5, 2005
  3. JPractitioner
    Replies:
    2
    Views:
    1,098
    Gordon Beaton
    Jan 18, 2006
  4. Roland
    Replies:
    4
    Views:
    16,044
    Esmond Pitt
    May 3, 2007
  5. fb1800
    Replies:
    0
    Views:
    961
    fb1800
    Dec 8, 2010
Loading...

Share This Page