In the symfony2 project I'm working on, deadlocks sometimes occur when flush called on my noun. This leads to an exception. In most cases, this error occurs only once, and a second attempt to insert the same data works correctly.
Is there a good approach to doing (resetting) the same transaction again. How simple
$em->flush();
will not be executed because the entitymanager closes if an error occurs.
I found a https://github.com/doctrine/doctrine2/pull/806 bit which does not provide a solution.
mysql deadlock doctrine2
Rene terstegen
source share