Details
Description
When doing transactional multi table update using DQL query the changes are not rolled back after exception is raised after the update.
$em->transactional(function($entityManager) {
$dql = "UPDATE ..."; // some multi table update DQL
$query = $entityManager->createQuery($dql);
$query->execute();
throw new Exception();
});
This is because Doctrine executes "DROP TABLE" for temporary table created for the update but MySQL is doing commit right after DROP and CREATE statements automatically.
From PHP documentation:
"Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit COMMIT will prevent you from rolling back any other changes within the transaction boundary."