android10 / android10/Android-CleanArchitecture

How to deal with transactions in domain layer

Open
#45 15 comments 2 reactions 0 assignees View on GitHub
discussion question
Dominant language
Java
Stars
15.5k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

I have a question about handling transactions between data and domain layer.
Think about a usecase where two entities should be persisted into a local database in one transaction.
Should the domain layer know something about "transactions" when calling into the data layer and what about "nested transaction"? Who is responsible to decide whether two or more operations should handled atomic as the domain layer doesn't know something about where and how the data is persisted.
Another point is also how to handle if there is a foreign key relationship between entities.

Thank you for any advice.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.