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

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

    The issue is related to how spring load classes and proxies. It will not work , untill you write your inner method / transaction in another class or go to other class and then again come to your class and then write the inner nested transcation method.

    To summarize, spring proxies does not allow the scenarios which you are facing. you have to write the 2nd transaction method in other class

提交回复
热议问题