Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL + Hibernate: HTTP servlet broken pipe with entity manager

 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic