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

前端 未结 8 2311
谎友^
谎友^ 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:31

    This is my solution for self invocation:

    public class SBMWSBL {
        private SBMWSBL self;
    
        @Autowired
        private ApplicationContext applicationContext;
    
        @PostConstruct
        public void postContruct(){
            self = applicationContext.getBean(SBMWSBL.class);
        }
    
        // ...
    }
    

提交回复
热议问题