Hibernate4 + c3p0 + Derby - Memory Leak on Tomcat stop or web application reload

前端 未结 2 1073
南方客
南方客 2020-12-21 02:22

I have a very simple application template which includes an embedded apache derby database through hibernate.

I have the following configuration:

            


        
2条回答
  •  一个人的身影
    2020-12-21 03:06

    A more concise version of the accepted answer that did the trick for me

    for (Object o : C3P0Registry.getPooledDataSources()) {
      try {
        ((PooledDataSource) o).close();
      } catch (Exception e) {
        // oh well, let tomcat do the complaing for us.
      }
    }
    

提交回复
热议问题