首页 > 其他 > 详细

整合ssh事务问题

时间:2015-01-05 07:09:54      阅读:267      评论:0      收藏:0      [点我收藏+]
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
	org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
  1. 1. 如果想让spring帮你管理事务,只能在spring中配置SessionFactory。如果使用hibernate原有的sessionFactory,则只能自己手动管理事务。  

  2. 如果想使用sessionFactory.getCurrentSession()方法,必须配置sessionFactory和jta或thread绑定。但是hibernate3.0不支持与thread绑定,3.1以上才支持。   

 3. sessionFactory.getCurrentSession()方法取得的session,在做数据库操作时必须在事务中做,包

括只读的查询,否则会报错。


整合ssh事务问题

原文:http://8092668.blog.51cto.com/8082668/1599108

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!