Skip to content
Preptima
hardConceptScenarioMidSeniorStaff

The inner service threw, you caught the exception in the caller, and then the commit failed with UnexpectedRollbackException. Why?

The inner method joined the caller's transaction, so its rollback rule marked the one physical transaction rollback-only. Catching the exception hides it from your code but not from the transaction manager, which then refuses to commit. Use REQUIRES_NEW when the inner work must be able to fail alone.

5 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

UnexpectedRollbackException happens when an inner transactional method joins the outer transaction, marks the shared physical transaction rollback-only, and the caller catches the original exception. The outer commit still fails because the transaction manager will not commit work it has already been told must roll back; use REQUIRES_NEW only when the inner work truly needs independent failure.

Was this answer helpful?

Likely follow-ups

  • What does REQUIRES_NEW cost you when the outer transaction already holds locks the inner one needs?
  • When is NESTED usable, and what does your persistence setup have to support for it?
  • Why does a checked exception commit by default, and where would you change that?
  • If the inner call only writes an audit record, is a transaction the right mechanism for it at all?

Related questions