Spring Boot auto-configures a transaction manager based on the libraries in the classpath. Here are some of the transaction managers for single relational databases:
- org.springframework.jdbc.datasource.DataSourceTransactionManager: Can manage transactions for one JDBC database resource
- org.springframework.orm.jpa.JpaTransactionManager: Can manage transactions for one JPA database resource
JTA is a standard for managing transactions in Java applications. It defines a resource-neutral approach for managing transactions. JTA supports transactions across multiple resources—across databases, queues, or any other resources.
Spring Boot supports JTA and makes it easy to participate in distributed transactions with multiple resources. You can use an Atomikos or Bitronix-embedded transaction manager as the implementation by adding the appropriate starters—spring-boot-starter-jta-atomikos or spring-boot-starter-jta-bitronix.