mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-12 10:49:52 +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:
parent
d56d00421a
commit
82fb98348b
5
.changes/unreleased/Fixed-20241216-153850.yaml
Normal file
5
.changes/unreleased/Fixed-20241216-153850.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Wrap handling of PdfSignedMessage into transactions
|
||||||
|
time: 2024-12-16T15:38:50.974937062+01:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
@ -51,11 +51,12 @@ final readonly class PdfSignedMessageHandler implements MessageHandlerInterface
|
|||||||
throw new \RuntimeException('no stored object found');
|
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();
|
$this->entityManager->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user