Skip to content

Transaction management? #297

@StevenDevooght

Description

@StevenDevooght

I was reviewing the ModularMonolith sample and trying to understand how SQL transactions are handled. Shouldn't the call to _productService.AddOrUpdateAsync(command.Product, cancellationToken) in the AddUpdateProductCommandHandler be wrapped in a transaction? If something goes wrong in either the ProductCreatedEventHandler or ProductUpdatedEventHandler, it could lead to an inconsistent state.

In the monolith sample, this operation is wrapped in a transaction. However the DeleteProductCommand also does not have a dedicated transaction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions