Hmmmm... During deployment time to our Linux server, I encountered this error that said
MySQL java.net.SocketException: Broken pipe
It was really becoming frustrating since I couldn't determine where the error was coming. Checked the code, eliminated those finally blocks where I close the connection. It didn't solve the problem. Finally, when I was about to give up(or am I being real here?), I found this solution.
in mysql terminal:
mysql> SHOW VARIABLES;
Look a variable called connect_timeout, then set it to a higher value than you had before. Mine was from 10 to 60
mysql>SET GLOBAL connect_timeout=60;
voila! The error is gone!
Reference sites:
http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html
http://archives.neohapsis.com/archives/mysql/2006-q1/1047.html
http://forums.mysql.com/read.php?39,42763,96476#msg-96476