🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It rolls back
  2. B.It commits, because by default only unchecked exceptions cause rollback
  3. C.It retries
  4. 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 →