Hibernate, C3P0, Mysql — Broken Pipe

后端 未结 5 480
予麋鹿
予麋鹿 2020-12-08 16:46

MySQL seems to have an 8 hour time out on its connections. I\'m running multiple WARs in Tomcat utilizing Hibernate for ORM. After 8 hours (i.e. overnight), I get broken pip

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 17:10

    There are two things going on here. You should read this article for more details, but the take-aways are:

    1. You can adjust the MySQL wait_timeout setting to something larger than 8 hours, if desired.
    2. The Hibernate settings should include "hibernate." before the "c3p0", e.g. hibernate.c3p0.idle_test_period instead of just c3p0.idle_test_period

提交回复
热议问题