🎙 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 2 of 10

By default, @Transactional rolls back when the method throws…

By default, @Transactional rolls back when the method throws…

  1. A.any exception, checked or unchecked
  2. B.an unchecked exception (RuntimeException or Error)
  3. C.only SQLException
  4. 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 →