Getting Exception and application not able to connect with MySqL Database when using connection pooling (c3p0-0.9.1.2) with Hibernate 3.2?

[亡魂溺海] 提交于 2019-12-08 03:26:41

it looks like you may be forgetting to close your hibernate SessionFactory when you hot-restart your web app. this leave's c3p0's helper Threads from a dead instance (which in Tomcat implies a now-broken ClassLoader) running uselessly and causing problems.

c3p0 DataSources should be close()ed promptly when they will no longer be used, to release all pooled Connections and helper Threads. For web apps, this should often be done via a ServletContextListener. if your pool is managed by hibernate, promptly closing the SessionFactory should do the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!