Restarting transaction in MySQL after deadlock

前端 未结 4 1119
后悔当初
后悔当初 2021-01-18 01:20

I am facing a deadlock in my MySQL. How can I configure MySQL to restart the transaction automatically when it encounters a deadlock?

4条回答
  •  梦谈多话
    2021-01-18 02:01

    Well, you can't and it would not make sense. It's up to your application to cope with deadlock and how it's done depends very much on your business logic, e.g. catch the exception, wait some seconds, retry x times ...

提交回复
热议问题