Understanding Spring Boot auto-configuration for transactions

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 resourcesacross 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 startersspring-boot-starter-jta-atomikos or spring-boot-starter-jta-bitronix.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset