This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes MySQL + Hibernate: HTTP servlet broken pipe with entity manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "MySQL + Hibernate: HTTP servlet broken pipe with entity manager" Watch "MySQL + Hibernate: HTTP servlet broken pipe with entity manager" New topic
Author

MySQL + Hibernate: HTTP servlet broken pipe with entity manager

Karsten Wutzke
Ranch Hand

Joined: Jul 20, 2010
Posts: 106

Hello,

please follow the URL: http://www.bbstats.net/home

This is just a test HTTP servlet running in parallel to the Seam 2/Hibernate/RichFaces webapp. The exception you see there stems from the code:
This just reads a few entities to see if they can be found. Of course I'm not using transactions in the servlet setup at hand which I should be doing, but since this is for testing purposes only I left them off.

I believe I've never tested this servlet and now after months I did and an exception is thrown:
Note the part:
The last packet successfully received from the server was 1,933,172,030 milliseconds ago. The last packet sent successfully to the server was 1,933,172,031 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

QUESTION: Could it be that the very old code line
is causing this because the EntityManager should actually be created in the doGet method instead of at servlet init (instantiation)?

Thanks
Karsten

PS: the 1,933,172,030 msec are ~22,5 days and that is around the time I last restarted the server.


OCJP JavaSE 6 (86%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL + Hibernate: HTTP servlet broken pipe with entity manager
 
Similar Threads
java.net.SocketException: Broken pipe
SQLException: Invalid value for getInt() + scrambled columns
CommunicationsException tomcat6 and mysql
Communication EXCEPTION
BasicDataSource Connection Pool Exception