java.net.SocketException: Broken pipe

谁说胖子不能爱 提交于 2020-01-03 18:04:36

问题


I am getting this for all the database connections from my app server..
This exception occured for couple of hours, then got fixed by itself.
Something to do with network connection from the appserver?

java.net.SocketException: Broken pipe
com.inet.tds.SQLException: java.net.SocketException: Broken pipe
java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at com.inet.tds.a.a(Unknown Source)
    at com.inet.tds.a.a(Unknown Source)
    at com.inet.tds.a.commit(Unknown Source)
    at com.inet.pool.a.commit(Unknown Source)

回答1:


For MySQL, "By default, the server closes the connection after eight hours if nothing has happened." And, MySQL has a reconnect feature that supports auto-reconnect after the closed connection is detected on the client side.

Eight hours? With the use of connection pooling or a long-running background job, that is possible.

http://dev.mysql.com/doc/refman/5.0/en/gone-away.html




回答2:


It means you client has disconnected from the server; check if it is running. See here




回答3:


During a write the connection was severed, this can be due the the destination closing the connection or the destination process has terminated. Its not an error with your implementation.



来源:https://stackoverflow.com/questions/682560/java-net-socketexception-broken-pipe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!