Skip to content

Commit 6861dd1

Browse files
committed
Mark transaction as valid use.
Tried removing this transaction for the removal of all unneccesary transactions. It turns out that this is actually a valid usecase that should be kept.
1 parent 00f98e2 commit 6861dd1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

webapp/src/Controller/BaseController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ protected function commitDeleteEntity(object $entity, array $primaryKeyData): vo
239239
}
240240

241241
// Now actually delete the entity.
242+
// This is a great use of a transaction! Order needs to be guaranteed. Normally deletion
243+
// succeeds, in cases where it does not, all work executed by the deletion must be restored
244+
// to bring the database in an expected and consistent state.
242245
$this->em->wrapInTransaction(function () use ($entity) {
243246
if ($entity instanceof Problem) {
244247
// Deleting a problem is a special case:

0 commit comments

Comments
 (0)