No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional

解决方法:

1,  

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">

 <!-- 事务控制   -->  
 <tx:annotation-driven transaction-manager="transactionManager" />

2,service层方法上加     @Transactional

猜你喜欢

转载自blog.csdn.net/zoucui/article/details/69948157