报错解决:No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
大概分析一般使用了注解才会报这方面的错
1.没有在spring的ApplicationContext.xml中开启注解事务
<!-- 开启注解事务 -->
<tx:annotation-driven transaction-manager="txManager"/>
大概分析一般使用了注解才会报这方面的错
1.没有在spring的ApplicationContext.xml中开启注解事务
<!-- 开启注解事务 -->
<tx:annotation-driven transaction-manager="txManager"/>
2.没有在方法上挂注解事务标签
本文分析了在Spring框架中遇到的No Hibernate Session bound to thread错误的原因,并提供了两个解决方案:一是确保已在ApplicationContext.xml中配置注解事务管理;二是正确使用@Transactional注解。
5563

被折叠的 条评论
为什么被折叠?



