You cannot do this automatically because a deadlock occurred because two transactions tried to change the same data . If you know that repeating the same statements again is correct, you need to implement this in your application.
However, the presence of such a database will automatically be irresponsible, as there may also be times when your application must first look at a new situation in the database before issuing potentially modified statements, if any.
Daniel Schneller
source share