Skip to content

Transaction with two aggregates #149

@MatyMatousek

Description

@MatyMatousek

Hello,
I'm trying to figure out how to make a transaction on two aggregates. I have the first aggregate "sequencer" for numbers and the aggregate "ticket". It should work like this: I get a number from a sequencer, which I assign to the ticket and I create it. If the ticket creation return an error, I need to undo the assigned number and discard getNumber command.
Is there a solution for my use case? E.g. do a lock on both aggregates at the same time and after updating them make commit both aggregates.
I looked at your library for SAGA, but it is only for generating commands based on events but does not allow invalidating previous commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions