org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session
来源:互联网 发布:船舶吨位是指 知乎 编辑:程序博客网 时间:2024/06/06 00:47
我在用Struts+Spring+Hibernate架构开发web项目时,在eclipse中启动tomcat没问题,能正常连接到数据库,但是我将项目上传到网站空间再进行数据库连接时遇到了Could not open Hibernate Session for transaction。最后我解决了这个问题。我现在把问题贴在了下面!我最终确定是因为数据链接自动关闭,而不是spring和hibernate的问题。
解决办法是:寻找支持重连的连接池。
在sessionFactory里配置:
<property name="hibernateProperties">
<props>
<prop key="hibernate.autoReconnect">true</prop>
</props>
</property>
转自:http://lxinchang2008.blog.163.com/blog/static/107304898201171165631943
0 0
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session f
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- org.springframework.transaction.CannotCreateTransactionException: Could not open
- org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for
- org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for
- org.springframework.transaction.CannotCreateTransactionException:
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction;
- Could not open Hibernate Session for transaction
- Could not open Hibernate Session for transaction
- 第一个Java程序
- 人生要小心处理的事
- 蓝桥杯,连号区间数
- IOS-UITextField
- SQL SERVER创建链接服务器
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session
- android-handler基本使用
- centos挂在一个共享文件夹
- listview里面checkbox选中状态乱蹦+滚动listview的时候自动调用 onCheckedChanged 导致CheckBox 状态不停变化
- var Store = connect.session.Store;TypeError: Cannot read property&
- 微软自带报表打印的实现
- 虚拟化识别加密狗解决方案
- 【百度地图开发之四】百度地图基本操作功能实现讲解
- iOS开发中手机号码和价格金额有效性判断及特殊字符的限制