I am facing a deadlock in my MySQL. How can I configure MySQL to restart the transaction automatically when it encounters a deadlock?
Restarting a transaction means:
commit
.Because the database engine cannot possibly know the queries which would have been executed after the deadlock occured, it cannot retry the whole thing for you (not to mention there could be application logic which would maybe execute different queries based on newly changed database data).