@Transactional(rollbackFor = XYZException.class)
괄호 안에 롤백을 수행할 익셉션을 명시해주면 된다.
ref : https://stackoverflow.com/questions/62887614/how-to-do-rollback-with-transactional-annotation
'Spring Boot' 카테고리의 다른 글
[Spring] 유니크 키 제약사항을 위반한 경우 HTTP 상태 코드 (0) | 2023.02.01 |
---|---|
[Spring] 2개 이상의 유니크 키를 분리하여 예외처리 하기 (0) | 2023.01.31 |
[JPA] @Entity @Table 차이점 (0) | 2022.09.14 |
[Spring] RestTemplate vs WebClient (0) | 2022.07.27 |
[Spring] 이전 페이지로 리다이렉트 시키기 (0) | 2022.06.09 |