ACID properties of transactions
Atomicity
@Transactional public void transferMoney(String fromAccountId, String toAccountId, int amount) { Account fromAccount = accountRepository.findById(fromAccountId); Account toAccount = accountRepository.findById(toAccountId); fromAccount.debit(amount); // μΆκΈ toAccount.credit(amount); // μ κΈ accountRepository.save(fromAccount); accountRepository.save(toAccount); }
Consistency
Isolation
Durability
νΈλμμ
μ²λ¦¬
Last updated