Recovery(coming soon)

Coming soon

In non-transactional environments, the recovery mechanism will allow you to execute some actions when a changeSet fails to simulate your manual "rollback". It works retrospectively in reverse order, so when a changeSet fails, it will run all the recovery methods associated with the executed changeSets, starting from the most recently executed.

Scenario

Execution order

ChangeSet

Recovery

State

1st

changeSet1

recovery_changeSet1

EXECUTED

2nd

changeSet2

no_recovery

EXECUTED

3rd

changeSet3

recovery_changeSet3

EXECUTED

4th

changeSet4

recovery_changeSet4

FAILED

Assuming a non-transactional environment, after changeSet4 fails, as it's not marked with failFast to false, Mongock will run the recovery process, which will run in order: recovery_changeSet4, recovery_changeSet3, recovery_changeSet1.

Please notice that changeSet2 does not provide any recovery, so it's ignored.