An afterCommit hook can be added to both managed and unmanaged transaction objects:

    afterCommit hooks are not raised if a transaction is rolled back

    You can use the afterCommit hook in conjunction with model hooks to know when a instance is saved and available outsideof a transaction

    1. model.afterSave((instance, options) => {
    2. // notify listeners the instance has been saved
    3. options.transaction.afterCommit(() => /* Notify */)
    4. }
    5. // Save done outside a transaction, safe for callers to fetch the updated model