How to restart transactions on deadlock/lock-timeout in Spring?

后端 未结 4 1505
野趣味
野趣味 2020-12-29 04:16

What is the best practice on implementing a transaction restart upon deadlock or lock timeout exceptions when using Spring (specifically the Spring recommended approach: dec

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 04:57

    There is no universal answer because it depends on application specifics. For example you may want to perform automatic transacted operation restart or notify the user about operation failure and ask for explicit retry confirmation etc.

    I'd use AOP in case of automatic restart scenario.

提交回复
热议问题