Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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?
     
    santhosh.R gowda
    Ranch Hand
    Posts: 296
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator


    Is there any change i had to made to overcome this problem....so please let me know
     
    Paul Sturrock
    Bartender
    Posts: 10336
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    santhosh.R gowda
    Ranch Hand
    Posts: 296
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    But here in log file of Data Base im not getting any error details
     
    santhosh.R gowda
    Ranch Hand
    Posts: 296
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
     
    Jan Cumps
    Bartender
    Posts: 2586
    11
    C++ Linux Netbeans IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic