首先,在my.ini中设置了
wait_timeout = 1828000
interactive-timeout = 1728000
max_connections = 1000
程序:hibernate配置了连接池
<property name="c3p0.min_size">10</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.time_out">1800</property>
<property name="c3p0.max_statement">1000</property>
方法有hibernate的template,也有session。 过滤器 sessioninviewfilter!
现在是内部使用 最多10人连接,但是到一,两个小时后就会爆 too many connections!
wait_timeout = 1828000
interactive-timeout = 1728000
max_connections = 1000
程序:hibernate配置了连接池
<property name="c3p0.min_size">10</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.time_out">1800</property>
<property name="c3p0.max_statement">1000</property>
方法有hibernate的template,也有session。 过滤器 sessioninviewfilter!
现在是内部使用 最多10人连接,但是到一,两个小时后就会爆 too many connections!
解决方案 »
- 我们大家一起来讨论一下Ioc容器接口的设计吧,共同进步
- hibernate中出现The method configure() is undefined for the type Configuration
- java.lang.ClassCastException: java.lang.String cannot be cast to common.User
- hibernate 的 dtd文件有什么用啊?
- spring+hibernate 如何这样事务管理
- 请高手们给 菜鸟 推荐几个J2EE学习网站, 多谢!
- 烦恼!关于JDBC
- 还是j2ee环境的问题, 如何配置j2ee环境?
- java单例模式
- java将jsp页面转化为图片或Pdf文件,怎么做?
- 如何知道hibernatetemplate中的方法执行成功
- 图片上传问题 急求解!
都设成1000了。是不是多次insert,update操作没有关闭session。
List<Enterpost> list = (List<Enterpost>) this.getHibernateTemplate()
.execute(new HibernateCallback() { public Object doInHibernate(Session session)
throws HibernateException, SQLException {
DetachedCriteria detachedCriteria = DetachedCriteria
.forClass(Enterpost.class);
Criteria criteria = detachedCriteria
.getExecutableCriteria(session);
criteria.setFirstResult((pageNow - 1) * pageSize);
criteria.setMaxResults(pageSize);
return criteria.list();
引用 4 楼 zijie885 的回复:
+++
另外 应用里面检测是否 有没有session未关闭的地方