您的位置:首页 > 编程语言 > Java开发

spring声明式管理事务+ hibernate + save is not valid without active transaction

2014-12-31 17:29 423 查看
spring整合hibernate时,spring使用注解配置声明式事务,并且applicationContext.xml配置正确,

还出现save is not valid without active transaction错误

那么很有可能是你在hibernate.cfg.xml文件中配置了

<property name="current_session_context_class">thread</property>

只要删了这个就行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐