Hibernate Could not obtain transaction-synchronized Session for current thread问题处理

项目通过Hibernate查询时报出如下错误:

Hibernate Could not obtain transaction-synchronized Session for current thread

解决办法:

在实现类上添加@Transactional注解即可。

image

原文地址:https://www.cnblogs.com/xusweeter/p/10016595.html