Skip to content

Commit

Permalink
Added calling of EntityManager::flush() in method `DoctrineAggregat…
Browse files Browse the repository at this point in the history
…eRootRepository::saveAggregateRoot()`
  • Loading branch information
tg666 committed Feb 23, 2024
1 parent 9d6157e commit 9e4b902
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function saveAggregateRoot(AggregateRootInterface $aggregateRoot): void
$this->em->persist($aggregateRoot);

$this->eventStore->store($aggregateRootClassname, $events);

$this->em->flush();

$this->eventPublisher->publish($aggregateRootClassname, $aggregateRoot->getAggregateId(), $events);
}
}

0 comments on commit 9e4b902

Please sign in to comment.