org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
2013-10-25 16:28
453 查看
org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
异常解决: 产生这个异常的原因是代码中使用了如下片段:
public class ConfigDaoImpl extends HibernateBaseTemplate implements ConfigDao {.........
this.getHibernateTemplate().getSessionFactory().getCurrentSession();
=====================
由于配置文件中是如下的用法:
<property name="current_session_context_class">thread</property>
如果改为:
<property name="current_session_context_class">jta</property>
则没问题.
[参照:http://blog.csdn.net/yinjian520/article/details/8666695]
异常解决: 产生这个异常的原因是代码中使用了如下片段:
public class ConfigDaoImpl extends HibernateBaseTemplate implements ConfigDao {.........
this.getHibernateTemplate().getSessionFactory().getCurrentSession();
=====================
由于配置文件中是如下的用法:
<property name="current_session_context_class">thread</property>
如果改为:
<property name="current_session_context_class">jta</property>
则没问题.
[参照:http://blog.csdn.net/yinjian520/article/details/8666695]
相关文章推荐
- SystemUI.apk安装问题
- CRM 2011 Install Errors - Tips and Tricks continued(转)
- ios推送:本地通知UILocalNotification
- iOS 3D UI---CALayer的transform扩展
- [原创] UI和3D特效同学正在努力中。。。
- UIX Developer's Guide
- Bluetooth在andriod下的开发基本操作
- 在HCI层看从inquiry的整个过程
- UIView中视图关系分析以及视图跳转动画的使用
- CreateIoCompletionPort和GetQueuedCompletionStatus函数
- Android4.2关于bluetooth在HAL层的分析
- iOS培训篇UIView层次——code介绍
- 【转】Bluedroid的结构和代码分布
- 解决CSRF verification failed. Request aborted.的问题
- UIImageview 点击事件
- 百度富文本编辑器ueditor使用总结
- chromium UI库简介
- UIView的layoutSubviews和drawRect方法何时调用
- PHP + mysql query
- 系统UITabBar属性设置