How do you configure XA transactions in Spring Boot?
Set up XA two-phase commit in Spring Boot with Atomikos, JtaTransactionManager and XA data sources, plus pitfalls and lighter alternatives.
2,886 posts about Java: questions with answers, tutorials and articles, newest first.
Set up XA two-phase commit in Spring Boot with Atomikos, JtaTransactionManager and XA data sources, plus pitfalls and lighter alternatives.
The Atomikos starter adds a JTA transaction manager to Spring Boot so one @Transactional method can span several XA resources using two-phase commit.
Learn how to run one atomic transaction across multiple databases in Spring Boot with JTA, XA data sources and a transaction manager, and when to avoid it.
@Rollback keeps Spring Boot tests isolated by undoing database changes after each test. See @DataJpaTest, @Commit and where rollback does not apply.
Spring Boot auto-configures a PlatformTransactionManager that backs @Transactional. Learn what it picks, when it backs off and how to use several data sources.
Spring Boot auto-configures transactions once a JPA or JDBC starter is present. Learn how to use @Transactional, rollback rules, propagation and TransactionTemplate.
@Transactional runs a method in a database transaction with automatic commit and rollback. Learn its rules, attributes and the pitfalls that stop it from working.
Use @Transactional on service methods and let Spring Boot auto-configure the transaction manager. Covers rollback rules, TransactionTemplate and pitfalls.
JobLauncher is the entry point that starts a Spring Batch job and creates its JobExecution. See sync and async launching, parameters and error handling.
Launch jobs with JobLauncher and monitor them through BatchStatus, JobExplorer, JobExecutionListener and Micrometer metrics, with restart and stop support.
ItemWriter receives a whole chunk of processed items and persists it inside the chunk transaction. See the Spring Batch 5 Chunk signature and built-in writers.
ItemProcessor transforms, validates or filters each item between the ItemReader and ItemWriter. See Spring Batch 5 wiring, filtering with null and composite processors.
ItemReader supplies one item per read() call to a chunk step and returns null at the end of input. See the built-in readers, builders and restart rules.
Spring Batch chunk steps combine a reader, processor and writer. See how to implement each, filter items and wire a job with the Spring Batch 5 builders.
StepBuilderFactory created pre-wired step builders in Spring Batch 4. Here is why it was deprecated and how to migrate to StepBuilder in Spring Batch 5.
Learn how to build tasklet and chunk-oriented steps in Spring Batch 5 using StepBuilder and JobRepository, with skip, retry and job wiring.
JobBuilderFactory was the Spring Batch 4 helper for creating jobs. It is deprecated in 5 and removed in 6, so use JobBuilder with a JobRepository.
spring-boot-starter-batch auto-configures Spring Batch so you can build restartable jobs with readers, processors and writers in Spring Boot.
Set up Spring Batch in Spring Boot 3: auto-configuration, a database job built from reader, processor and writer, scheduled launches and tests.
AsyncUncaughtExceptionHandler receives exceptions from void @Async methods that would otherwise vanish. Learn how to implement, register and test it.