Skip to content

Commit

Permalink
DoctrinePersistenceAdapter: EntityManager is cleared only if there is…
Browse files Browse the repository at this point in the history
… not an active transaction
  • Loading branch information
tg666 committed Oct 30, 2024
1 parent 4595443 commit f2d6641
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function commitTransaction(): void

$em->flush();
$em->getConnection()->commit();
$em->clear();

if (!$em->getConnection()->isTransactionActive()) {
$em->clear();
}
} catch (DbalException $e) {
throw TransactionException::unableToCommitTransaction($e->getMessage());
}
Expand Down

0 comments on commit f2d6641

Please sign in to comment.