intermediateTransactions with @Transactional
Does @Transactional roll back on every exception by default?
No — by default it only rolls back on unchecked exceptions (RuntimeException and subclasses). A checked exception does NOT trigger a rollback unless you explicitly configure `@Transactional(rollbackFor = Exception.class)`, which is a common source of silent partial-write bugs.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response