35. Distributed Transactions with JTA
Spring Boot supports distributed JTA transactions across multiple XA resources using either an Atomikos or Bitronix embedded transaction manager. JTA transactions are also supported when deploying to a suitable Java EE Application Server.
When a JTA environment is detected, Spring’s JtaTransactionManager
will be used to manage transactions. Auto-configured JMS, DataSource and JPA beans will be upgraded to support XA transactions. You can use standard Spring idioms such as @Transactional
to participate in a distributed transaction. If you are within a JTA environment and still want to use local transactions you can set the spring.jta.enabled
property to false
to disable the JTA auto-configuration.