org.hibernate.exception.GenericJDBCException: Cannot open cconnection(执行几次查询之后就不能查询/页面动不了/分页查询只能点击几)
2014-02-22 16:02
453 查看
org.hibernate.exception.GenericJDBCException: Cannot open cconnection(执行几次查询之后就不能查询/页面动不了/分页查询只能点击几而已)
解决方案:
SSH中使用类似 this.hibernateTemplate.getSessionFactory().openSession().createSQLQuery(sqlString)的查询功能多次后,页面会卡死不动,主要是因为session的没有关闭内存不断攀升所致,解决方法可以将语句拆开,然后关闭session;
SSH中使用类似 this.hibernateTemplate.getSessionFactory().openSession().createSQLQuery(sqlString)/分页查询只能点击几次而已,就报 Cannot open cconnection,主要是因为session的没有关闭连接所致,解决方法可以将语句拆开,然后关闭session;
如:
Session session=this.getHibernateTemplate().getSessionFactory().openSession();
List list = session.createSQLQuery(sqlString).list();
session.clear();//关闭session
session.close();//关闭连接con
解决方案:
SSH中使用类似 this.hibernateTemplate.getSessionFactory().openSession().createSQLQuery(sqlString)的查询功能多次后,页面会卡死不动,主要是因为session的没有关闭内存不断攀升所致,解决方法可以将语句拆开,然后关闭session;
SSH中使用类似 this.hibernateTemplate.getSessionFactory().openSession().createSQLQuery(sqlString)/分页查询只能点击几次而已,就报 Cannot open cconnection,主要是因为session的没有关闭连接所致,解决方法可以将语句拆开,然后关闭session;
如:
Session session=this.getHibernateTemplate().getSessionFactory().openSession();
List list = session.createSQLQuery(sqlString).list();
session.clear();//关闭session
session.close();//关闭连接con
相关文章推荐
- 大数据查询时出现 org.hibernate.exception.GenericJDBCException: Cannot open connection 请求支援
- 【知识整理】nested exceptionis org.hibernate.exception.GenericJDBCException: Cannot open connection。
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- 解决 org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot open connection
- org.hibernate.exception.JDBCConnectionException: Cannot open connection
- org.hibernate.exception.GenericJDBCException: Cannot release connection
- cloudera-scm-server启动时出现Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection问题解决方法(图文详解)
- org.hibernate.exception.GenericJDBCException: Could not open connection
- org.hibernate.exception.GenericJDBCException: Could not open connection解决思路 SSH框架
- org.hibernate.exception.GenericJDBCException: Could not open connection
- org.hibernate.exception.JDBCConnectionException: Cannot open connection
- org.hibernate.exception.JDBCConnectionException: Cannot open connection