Skip to content

Refactor ValidationManager and fix some bugs

akwizgran requested to merge 619-validation-transactions into master

The validation manager uses a pattern of throwing an exception from within a transaction, then trying to ensure that the transaction gets committed anyway by setting it complete in a finally block. This is a bad idea - if the intentional exception isn't thrown but a later method throws an unintentional exception, the changes up to that point will be committed instead of rolled back.

I reworked the control flow to remove this pattern, and in the process realised that the validation manager was doing a lot of work to provide objects to attach to MessageStateChangedEvents, which are only used by tests these days. So I fixed that and a couple of other issues.

The VALID state is no longer needed and has been removed.

Closes #619 (closed)

Merge request reports