liveBook · Manning

Transactional annotation

Spring’s @Transactional annotation declares that a class or method should execute with specified transaction semantics managed by Spring.

How 2 Manning books explain it

Quarkus in Action

@Transactional is an annotation that defines a transaction boundary for an operation executed within a conventional transaction context.

How it is used
Marks CDI methods that persist or modify database entities so their changes can be committed.
How deep it goes
Explains default boundary behavior, six transaction types, class-level use, and a programmatic alternative without detailing transaction-manager internals.
Examples
Uses a reservation POST that persists an entity, GraphQL mutations that persist or delete cars, and a gRPC lambda requiring a new transaction.
What you can do after
Apply it via Jakarta Transactions in Quarkus to bound CDI write methods and select transaction behavior for incoming calls.

Read how Quarkus in Action explains Transactional annotation →

Java Persistence with Spring Data and Hibernate epub

The Spring Transactional annotation declares that method or class execution participates in transaction management.

How it is used
Declares transaction boundaries and execution behavior for Spring persistence operations and transactional tests.
How deep it goes
Explains placement, inheritance, rollback rules, transaction properties, configuration, and test lifecycle without descending into transaction-manager internals.
Examples
Uses ItemDaoImpl and BidDaoImpl classes, DatabaseService initialization, and Spring transactional tests with UserService.
What you can do after
Operate/configure Spring persistence components and tests with explicit rollback, propagation, isolation, timeout, and read-only policies.

Read how Java Persistence with Spring Data and Hibernate epub explains Transactional annotation →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.