简体   繁体   English

java.net.SocketException:管道损坏

[英]java.net.SocketException: Broken pipe

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? 与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)

For MySQL, "By default, the server closes the connection after eight hours if nothing has happened." 对于MySQL,“默认情况下,如果没有发生任何事情,服务器会在八小时后关闭连接。” And, MySQL has a reconnect feature that supports auto-reconnect after the closed connection is detected on the client side. 并且,MySQL具有重新连接功能,支持在客户端检测到关闭连接后自动重新连接。

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 http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

It means you client has disconnected from the server; 这意味着您的客户端已与服务器断开连接; check if it is running. 检查它是否正在运行。 See here 看这里

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. 它不是你的实现错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM