diff --git a/.changes/unreleased/Fixed-20241216-153850.yaml b/.changes/unreleased/Fixed-20241216-153850.yaml new file mode 100644 index 000000000..09b3a3a7e --- /dev/null +++ b/.changes/unreleased/Fixed-20241216-153850.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Wrap handling of PdfSignedMessage into transactions +time: 2024-12-16T15:38:50.974937062+01:00 +custom: + Issue: "" diff --git a/src/Bundle/ChillDocStoreBundle/Service/Signature/Driver/BaseSigner/PdfSignedMessageHandler.php b/src/Bundle/ChillDocStoreBundle/Service/Signature/Driver/BaseSigner/PdfSignedMessageHandler.php index e97781a15..7b94b3124 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/Signature/Driver/BaseSigner/PdfSignedMessageHandler.php +++ b/src/Bundle/ChillDocStoreBundle/Service/Signature/Driver/BaseSigner/PdfSignedMessageHandler.php @@ -51,11 +51,12 @@ final readonly class PdfSignedMessageHandler implements MessageHandlerInterface throw new \RuntimeException('no stored object found'); } - $this->storedObjectManager->write($storedObject, $message->content); + $this->entityManager->wrapInTransaction(function () use ($storedObject, $message, $signature) { + $this->storedObjectManager->write($storedObject, $message->content); - $this->signatureStepStateChanger->markSignatureAsSigned($signature, $message->signatureZoneIndex); + $this->signatureStepStateChanger->markSignatureAsSigned($signature, $message->signatureZoneIndex); + }); - $this->entityManager->flush(); $this->entityManager->clear(); } }