N° 01 — 목록
'Propagation' (1)
-
Backend Development/SpringSpring - 09. transaction
@Transactional이 rollback하지 않는 예외 — 트랜잭션 관리의 함정@Servicepublic class TransferService { @Transactional public void transfer(Long from, Long to, long amount) { accountRepository.withdraw(from, amount); try { externalService.notify(to); // 외부 API 호출 실패 } catch (Exception e) { log.warn("알림 실패", e); // 예외를 잡아서 처리함 } accountRepositor..