分析 org.hibernate.HibernateException: No Session found for current thread
/**
*
* org.hibernate.HibernateException: No Session found for current thread
* 分析:getCurrentSession()和当前事务有关系
*
* Spring hibernate 事务的流程
*
* 1.在方法开始之前
* ①.获取Session
* ②.把Session 和当前线程绑定,这样就可以在Dao中 使用SessionFactory 的
* getCurrentSession() 方法来获取Session 了
* ③.开启事务
*
* 2.执行业务方法
* 1)出现异常
* ①.回滚事务
* 2)正常结束
* ①.提交事务
* finally{
* ②.和当前线程绑定的Session解除绑定
* ③.关闭Session
* }
*
* 结论:
* 只要使用getCurrentSession()来获取Session,则
* ①必须配置事务
* ②必须在配置事务属性时,包含所有的业务方法
*/
分析 org.hibernate.HibernateException: No Session found for current thread的更多相关文章
- org.hibernate.HibernateException: No Session found for current thread
		spring.springmvc和hibernate整合 在sessionFactory.getCurrentSession()时,出现以下异常 No Session found for curren ... 
- spring+hibernate整合:报错org.hibernate.HibernateException: No Session found for current thread
		spring+hibernate整合:报错信息如下 org.hibernate.HibernateException: No Session found for current thread at o ... 
- SSH dao层异常 org.hibernate.HibernateException: No Session found for current thread
		解决方法: 在 接口方法中添加 事务注解 即可. public interface IBase<PK extends Serializable, T> { @Transactional v ... 
- hibernate在使用getCurrentSession时提示no session found for current thread
		大致错误片段 org.hibernate.HibernateException: No Session found for current thread at org.springframework. ... 
- Hibernate4集成spring4报错----No Session found for current thread
		在编写一个Hibernate4集成spring4的小demo的时候出现了该错误: org.hibernate.HibernateException: No Session found for curr ... 
- 关于spring3中No Session found for current thread!and Transaction的配置和管理(转)
		今天我是特别的郁闷,本来项目做到一半,以前都好好的,结果下午就出现问题,苦逼的到现在才解决.它出现问题的时候都一声不坑, ,(天啦,现在才发现CSDN啥时候把QQ表情给整过来了)就在注册用户的时候,咦 ... 
- Hibernate4 No Session found for current thread原因
		Hibernate4 与 spring3 集成之后, 如果在取得session 的地方使用了getCurrentSession, 可能会报一个错:“No Session found for curre ... 
- SSH2 No Session found for current thread原因
		Hibernate4 与 spring3 集成之后, 如果在取得session 的地方使用了getCurrentSession, 可能会报一个错:“No Session found for curre ... 
- Hibernate4 No Session found for current thread
		Hibernate4 与 spring3 集成之后, 如果在取得session 的地方使用了getCurrentSession, 可能会报一个错:“No Session found for curre ... 
随机推荐
- elasticSearch6源码分析(1)启动过程
			1.找到bin目录,下面有elasticSearch的sh文件,查看执行过程 exec \ "$JAVA" \ $ES_JAVA_OPTS \ -Des.path.home=&qu ... 
- javascript实例——鼠标特效篇(包含2个实例)
			鼠标是现在电脑的基本配置之一,也是最常用的输入命令的工具之一.本文将将一些与鼠标有关系的特效. 1.跟随鼠标移动的彩色星星 如题,会根据鼠标的移动而移动,并在鼠标周围随机来回移动,让人感觉在放大缩小. ... 
- [转]C#综合揭秘——Entity Framework 并发处理详解
			本文转自:http://www.cnblogs.com/leslies2/archive/2012/07/30/2608784.html 引言 在软件开发过程中,并发控制是确保及时纠正由并发操作导致的 ... 
- Python__组合数据类型
			组合数据:集合类型.序列类型(元组类型.列表类型).字典类型 集合: 定义:集合是多个元素的无序组合.(无序,唯一,Python中要求放入集合中的数据类型是不可变的). 集合用大括号 {}表示,元素间 ... 
- 南阳nyoj 56  阶乘因式分解(一)
			阶乘因式分解(一) 时间限制:3000 ms | 内存限制:65535 KB 难度:2 描述 给定两个数m,n,其中m是一个素数. 将n(0<=n<=10000)的阶乘分解质因数, ... 
- data whitening
			http://ufldl.stanford.edu/tutorial/unsupervised/PCAWhitening/ 
- JAVA虚拟机的生命周期
			一个运行时的Java虚拟机实例的天职是:负责运行一个java程序.当启动一个Java程序时,一个虚拟机实例也就诞生了.当该程序关闭退出,这个虚拟机实例也就随之消亡.如果同一台计算机上同时运行三个Jav ... 
- ctcms Nginx 伪静态
			location /whole { rewrite ^/whole/(.+).html$ /index.php?c=whole&key=$1; } location /show { rewri ... 
- vip会员统计表 (vip等级是灵活配置的 非写死1是金卡用户 2是什么 等)
			一个非常常见的报表,分析会员组成比例 以及最新增长情况 和上月同期会员增长情况. 比较特殊一点的是 报表中的 普通会员 和 金卡会员 临时会员 银卡会员 等列 都是根据会员等级配置表动态生成的(即 ... 
- map与pagelayout同步新方法
			本文转自: http://hi.baidu.com/murphy1314/blog/item/3d3144f319b19dcf0a46e0a4.html 前天写的那个MapControl和Pagela ... 
