CodelyTV / php-ddd-example

🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 6

Home Page:https://pro.codely.tv/library/ddd-en-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Database transaction boundary

gabrielanhaia opened this issue · comments

Hey there.

This is not 100% a request for a feature, but it might be interesting for some people to know (as for me).

I would like to know where you guys would wrap the database insertion into a transaction.

Looking at the project, my best guess would be here:

protected function persist(AggregateRoot $entity): void

But I am not 100% sure.

Thanks a lot in advance, and feel free to close this issue if it is the wrong channel

Wrapping the Use Case or doing a middleware before the command handler. Something like this 🙂