![](/img/trans.png)
[英]Spring @Transactional doesn't work for an annotated method when called from within service class
[英]Spring is not creating the bean for @service annotated class when one of its method is annotated with @transactional
spring 應用程序無法啟動,因為它無法為 class 找到一個 bean,該 bean 使用 @Service 注釋以在配置 class 中自動裝配。 但它僅在我使用 @Transactional 注釋特定服務 class 中的方法時發生。 為什么會這樣?
While you annotate your class by @Transactional spring use AOP and if your class is final and has no interfaces it cannot create a proxy on your class.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.