Thursday, May 7, 2009

java.sql.SQLException: Io exception: Broken pipe

It seems that connection is broken and we are trying to run a query on it. Try to add a PoolPing query and validate every connection before running it to as application. Now assuming that our ping query really worked and gave us a good connection, there is still a possibility that the connection is really good when you get it from the pool and goes bad while you’re running your app. Following could be the possibilities which could be causing it.
1. Physical connection was killed midstream – That is, some sort of network problem that is causing connections to be dropped after a period of time. If there are firewalls between the app server and database, those are frequently configured to kill connections after a period of time or simply a router problem.
Solution: Track down the problem.
2. The connections to the DB server are being reset and the client (the driver) is not notified. This can happen if the DB server times out and shuts down the connection w/o notifying the client. This can also be caused by firewalls dropping connections.
Solution: Set your connection timeout (in the pool) shorter than the network/DB server timeout.
Set your steady-connection size to 0.

No comments:

Post a Comment