Folks, The problem statement can be found as follows, Background:
- the application collect user information, which can be modeled by AggregateA, and AggregateB;
- AggregateA contains a collection of AggregateB
- AggregateA/B contains a small number of Entities
- the application persists AggregateA then AggregateB (the primary key of AggregateA is used an input to persist AggregateB)
Question: in the service layer, is there any alternative to this?
def add_user_info(varA, varB):
A_ID = repoA.add(varA)
repoA.commit()
repoB.add(A_ID, varB)
repoB.commit()
is it possible to have a single commit in this insertion?