Spring @Transaction method call by the method within the same class, does not work?

前端 未结 8 2220
谎友^
谎友^ 2020-11-22 05:07

I am new to Spring Transaction. Something that I found really odd, probably I did understand this properly.

I wanted to have a transactional around method level and

8条回答
  •  悲&欢浪女
    2020-11-22 05:45

    You can autowired BeanFactory inside the same class and do a

    getBean(YourClazz.class)

    It will automatically proxify your class and take into account your @Transactional or other aop annotation.

提交回复
热议问题