| - |
Exception |
RuntimeException |
| 정의 |
Runtime Exception을 제외한 모든 Exception |
Runtime Exception 하위 Exception |
| 예외처리 |
명시적인 예외처리 필요 |
명시적인 예외처리를 강제하지 않음 |
| 시점 |
Compile Time |
Runtime |
| 트랜젝션 처리 |
non-rollback |
rollback |
#. @Transactional
- CheckedException 의 경우 롤백이 되지 않고, RuntimeException 의 경우 롤백이 된다.
#. rollbackFor 옵션
@Transactional(rollbackFor = Exception.class)
@Transactional(rollbackFro = {RuntimeException.class, Exception.class})
#. noRollbackFor 옵션
- 특정 예외 발생 시 롤백이 되지 않도록 하는 방법
@Transactional(noRollbackFor={IgnoreRollbackException.class})