Transactional annotation
Spring’s @Transactional annotation declares that a class or method should execute with specified transaction semantics managed by Spring.
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
- database transactionconfigures · A database transaction is a logical unit of database operations whose changes are committed together or rolled back as a whole.
- aspectconfigures · An aspect is a modular unit of cross-cutting behavior applied around selected program operations or method invocations.
- handlerconfigures · A handler is a callable or software component that processes an event, request, message, or other input and performs associated processing.
- @WithTransactionequivalent to · @WithTransaction is an annotation that defines a transaction boundary for an asynchronous Hibernate Reactive operation.
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.

