佟刚视频Spring4整合hibernate时出现No Session found for current thread错误

今天在学习Spring4整合hibernate时
private Session getSession(){
return sessionFactory.getCurrentSession();
}
的哪个@Repository类是不可以直接调用方法来测试的,因为这些方法的getCurrentSession()还没有绑定事物。
应该用@Service类的方法去调用@Repository类的方法
因为@Service类被事物关联


service.* .*(…))” id=“txPointcut”/>

你可能感兴趣的:(佟刚视频Spring4整合hibernate时出现No Session found for current thread错误)