mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
Wrap PdfSignedMessage handling in a transaction
Ensure atomicity when writing stored objects and marking signatures as signed by wrapping these operations in a database transaction. This reduces the risk of partial updates and improves data consistency.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user