When a with @Transactional annotated method throws an Exception, but no classes are declared in rollbackFor, will the transaction be rolled back or not?
When a with @Transactional annotated method throws an Exception, but no classes are declared
Share
By default transaction is rolled back for unchecked exceptions (subclasses of
RuntimeExceptionandError), and not rolled back for checked exceptions.This behaviour can be customized by
rollbackForandnoRollbackForattributes.See also: