報錯解決: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"/>

2.沒有在方法上掛注解事務標簽

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM