← Quiz: Relationships and Transactions: all 10 questions
Quiz: Relationships and Transactions · Question 2 of 10
By default, @Transactional rolls back when the method throws…
By default, @Transactional rolls back when the method throws…
- A.any exception, checked or unchecked
- B.an unchecked exception (RuntimeException or Error)
- C.only SQLException
- D.nothing — you must call rollback()
Answer & explanation
Correct answer: an unchecked exception (RuntimeException or Error)
Checked exceptions need rollbackFor to trigger a rollback.
Can you get the rest right without peeking?
Take the timed Quiz: Relationships and Transactions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →