← Quiz: Relationships and Transactions: all 10 questions
Quiz: Relationships and Transactions · Question 8 of 10
A service method declares throws IOException and throws one. With a plain @Transactional, what happens?
A service method declares throws IOException and throws one. With a plain @Transactional, what happens?
- A.It rolls back
- B.It commits, because by default only unchecked exceptions cause rollback
- C.It retries
- D.Spring converts it to 409
Answer & explanation
Correct answer: It commits, because by default only unchecked exceptions cause rollback
Use rollbackFor = Exception.class if checked exceptions must roll back.
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 →