Spring new transaction combined with Retryable

后端 未结 1 1158
甜味超标
甜味超标 2021-01-22 04:02

If I have a method that has a Spring retryable for a certain exception, and also has a Transactional(Requires_new), every time the retry is done, will it create a new transactio

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-22 04:32

    will be created new transaction each time. it the same as get service from spring context and call method N times. every call creates new transaction (use propagation that you added into service or method). Call your transactioanl servics method call it's call a proxy, retry calls that proxy also. Also your transaction might have timeout,retry try call in new timeout duration ,not N try times in one timeout

    0 讨论(0)
提交回复
热议问题