org.hibernate.HibernateException: connnection proxy not usable after transaction

2019独角兽企业重金招聘Python工程师标准>>> org.hibernate.HibernateException: connnection proxy not usable after transaction

org.hibernate.HibernateException: connnection proxy not usable after transaction completion 
at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:42) 
at $Proxy10.prepareStatement(Unknown Source) 
at com.bjqa.crm.zizhu.ddgl.biz.DzfddDao.doUpdateDdzt(DzfddDao.java:714) 
at com.bjqa.crm.zizhu.ddgl.biz.DzfddDao.OrderSettlement(DzfddDao.java:619) 
at com.bjqa.crm.zizhu.ddgl.action.DdzfServletAction.doPost(DdzfServletAction.java:113) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 

 

 

1.混用 hibernate + jdbc? 

2、con = DBPool.getInstance().getConnection();  建议直接使用session获取,也不需要自己关闭,由spring事务管理; 

3、尽量不要混用,如果混用hibernate二级缓存可能会出现问题

 

4.统一用连接池管理

转载于:https://my.oschina.net/xiaominmin/blog/551082

上一篇:上传下载文件


下一篇:javaweb 简单的注册登录功能