Given following @Transactional
annotation defined on a class.
@Transactional(rollbackFor = CheckedException.class)
Will Spring still Rollback on thrown Unchecked (Runtime
) exception plus the CheckedException.class
? Or given the above annotation, will it rollback only for the listed Exceptions,i.e., CheckedException.class
in this case?
Any runtime exception will always cause rollback, whether you mention a checked exception in rollbackFor or not.