c3p0数据库连接池,连接没有关闭解决办法

c3p0数据库连接池,连接没有关闭解决方法

本文前提是spring控制hibernate的c3p0连接池的连接没有在使用完关闭。请在applicationContext.xml文件中找到控制hibernate的属性,在里面添加<prop key="hibernate.connection.release_mode">after_statement</prop>这一行,这样就能在查询完成后自动关闭连接,不会出现连接耗光的情况了。