@Transactional method called from another method doesn't obtain a transaction

后端 未结 3 1798
抹茶落季
抹茶落季 2020-11-27 17:48

In Spring, a method that is annotated with @Transactional will obtain a new transaction if there isn\'t one already, but I noticed that a transactional method

3条回答
  •  借酒劲吻你
    2020-11-27 18:42

    It is one of the limitations of Springs AOP. Because the dao bean is in fact a proxy when it is created by spring, it means that calling a method from within the same class will not call the advice (which is the transaction). The same goes for any other pointcut

提交回复
热议问题