mtarld / apip-ddd

An example of hexagonal API Platform 3 implementation
MIT License
322 stars 55 forks source link

Implementing ACID Transactions #52

Closed yceruto closed 11 months ago

yceruto commented 11 months ago

Closes #46

Introduces ACID (Atomicity, Consistency, Isolation, Durability) transactions, which are designed to improve data integrity and consistency. This enhancement involves the implementation of a new transaction management system using Doctrine Transaction Middleware within the Messenger component for command handlers.

This approach guarantees that once transactions are committed, they remain stable and unaffected by system failures.

I didn't check the tests yet...

yceruto commented 11 months ago

Some tests seem broken with this change

Yeah, still checking DoctrineBookRepositoryTest...

yceruto commented 11 months ago

Tests updated!

yceruto commented 11 months ago

I added a NullMiddleware instead of conditionally adding the Doctrine transaction middleware. I preferred this approach because the messenger configuration is clearer. It's ready on my side.