HibernateException: Could not obtain transaction-synchronized Session for current thread

后端 未结 4 1164
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 21:16

I am getting error:

Exception in thread \"main\" org.hibernate.HibernateException: 
Could not obtain transaction-synchronized Session for current thread
         


        
4条回答
  •  粉色の甜心
    2021-01-04 22:06

    With Hibernate 4.x and Spring 4.x, just Add @Transactional after @Repository it will solve this synchronizaion exception.

提交回复
热议问题