You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by ldauvilaire August 23, 2022
Storage (i.e. Database) transactions have to be managed or else data integrity can be broken in case of access in parallel.
The use cases : DepositFundsUseCase and WithdrawFundsUseCase shall use only one transaction (read and update done into the same transaction).
The current code is using 2 (implicit) transactions, one for reading (repository.findRequired(accountNumber)) and another one for updating (repository.update(bankAccount)), this would not work in a "real" bank.
Of course the @transactional shall not be implemented into the domain but into driven port(s).
May be a "TransfertFund" from one account to another would help to show the problem in evidence.
The text was updated successfully, but these errors were encountered:
Discussed in https://github.com/valentinacupac/banking-kata-java/discussions/54
Originally posted by ldauvilaire August 23, 2022
Storage (i.e. Database) transactions have to be managed or else data integrity can be broken in case of access in parallel.
The use cases : DepositFundsUseCase and WithdrawFundsUseCase shall use only one transaction (read and update done into the same transaction).
The current code is using 2 (implicit) transactions, one for reading (
repository.findRequired(accountNumber)
) and another one for updating (repository.update(bankAccount)
), this would not work in a "real" bank.Of course the @transactional shall not be implemented into the domain but into driven port(s).
May be a "TransfertFund" from one account to another would help to show the problem in evidence.
The text was updated successfully, but these errors were encountered: