Transactions

Transactions with @Transactional: what it wraps, when it rolls back, why self-calls skip it, and REQUIRES_NEW.

  • 7 cards
  • 4 questions
  • About 7 min
  • Intermediate to Advanced
Share

@Transactional, the annotation that makes a method's database work succeed or fail as one unit. It looks like one annotation with one job, and it has two behaviours that surprise almost everyone: what it does with a checked exception, and what happens when a method calls a transactional method in its own class. It covers what the annotation wraps, a working commit, the rollback rules, self-invocation, and the REQUIRES_NEW propagation. It leaves out isolation levels and distributed transactions.

Contents

7 cardsnot started