Spring @Transactional Annotation : Self Invocation

前端 未结 2 862
半阙折子戏
半阙折子戏 2020-12-09 11:44

I know when a transactional method is called from inside the same class it wouldn\'t be run in a transaction. Spring creates a proxy for transactional methods and wraps them

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 11:45

    If you call saveAB and saveB throws an Exception, your transaction will rollback.

    Self-invocation doesn't break the transnational context. It just not starts one if nk contdxt id available.

提交回复
热议问题