Forums Register Login

JDBC Driver: Connection reset by peer: socket write error - ms-sqlserver

+Pie Number of slices to send: Send
Hi Friends,

Here my problem is "java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]System Exception: Connection reset by peer: socket write error".

I'm receiving the above error from my application. ( i.e )my application is communicating with Sql Server continously, and there is no request for a long time from my application to SqlServer and if i tried any request to Sql Server. im getting this error.


I just want to know, is the problem is from Sql Server side or from my application.

Whatever it is please help me to solve this. I couldn't able to reproduce this problem.

+Pie Number of slices to send: Send
"Connection reset by peer" means the SQL Server instance itself deliberately closed yopur connection. There are a number of reasons this could happen depending on what your application is doing:

  • The SQL Server instance may have been stopped
  • The connection has timed out
  • In the case of binary data, the stream is reset.


  • It sounds like the second reason is the most likely. My guess is you open a connection and leave it open doing nothing, is this the case?
    +Pie Number of slices to send: Send


    Is there any change i had to made to overcome this problem....so please let me know
    +Pie Number of slices to send: Send
    I don't think it is your DataSource definition that is the problem. Do you always close connections? Has the database server been restarted? Look in the SQL Server logs, it should tell you what caused the server to decide to drop the connection.
    +Pie Number of slices to send: Send
    But here in log file of Data Base im not getting any error details
    +Pie Number of slices to send: Send
    hi Paul
    I 'm getting the same error after three days .so when i restart my tomcat it is working fine but .im not getting why this is going to be happining and i observed that if no request came to my tomcat for 2 days then it will give this error..
    and i had also increased

    in my server.xml file so kindly help in overcome this problem
    +Pie Number of slices to send: Send
    Can you use the validationquery functionallity of your connection pool? It will validate connections before giving them to you, and discards and recreates stale connections.

    Regards, Jan
    All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 37983 times.
    Similar Threads
    Error Message
    Oracle Connection Error
    visual J++ and retreiving rows from sql server
    JDBC Conection pool
    SQL server connection problem
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 29, 2024 09:37:42.