Remove support for Atomikos

Closes gh-28589
This commit is contained in:
Andy Wilkinson
2021-11-10 20:17:53 +00:00
parent 900085628a
commit ef02cc9bff
32 changed files with 31 additions and 1813 deletions

View File

@@ -793,10 +793,9 @@ features.caching.provider.caffeine=io.caching.provider.caffeine
features.caching.provider.simple=io.caching.provider.simple
features.caching.provider.none=io.caching.provider.none
features.jta=io.jta
features.jta.atomikos=io.jta.atomikos
features.jta.javaee=io.jta.javaee
features.jta.javaee=io.jta.jakartaee
features.jta.mixing-xa-and-non-xa-connections=io.jta.mixing-xa-and-non-xa-connections
features.jta.supporting-alternative-embedded-transaction-manager=io.jta.supporting-alternative-embedded-transaction-manager
features.jta.supporting-alternative-embedded-transaction-manager=io.jta.supporting-embedded-transaction-manager
features.email=io.email
features.quartz=io.quartz
features.resttemplate=io.rest-client.resttemplate

View File

@@ -1,7 +1,6 @@
[[io.jta]]
== Distributed Transactions with JTA
Spring Boot supports distributed JTA transactions across multiple XA resources by using an https://www.atomikos.com/[Atomikos] embedded transaction manager.
JTA transactions are also supported when deploying to a suitable Java EE Application Server.
Spring Boot supports distributed JTA transactions across multiple XA resources by using a transaction manager retrieved from JNDI.
When a JTA environment is detected, Spring's `JtaTransactionManager` is used to manage transactions.
Auto-configured JMS, DataSource, and JPA beans are upgraded to support XA transactions.
@@ -10,28 +9,11 @@ If you are within a JTA environment and still want to use local transactions, yo
[[io.jta.atomikos]]
=== Using an Atomikos Transaction Manager
https://www.atomikos.com/[Atomikos] is a popular open source transaction manager which can be embedded into your Spring Boot application.
You can use the `spring-boot-starter-jta-atomikos` starter to pull in the appropriate Atomikos libraries.
Spring Boot auto-configures Atomikos and ensures that appropriate `depends-on` settings are applied to your Spring beans for correct startup and shutdown ordering.
By default, Atomikos transaction logs are written to a `transaction-logs` directory in your application's home directory (the directory in which your application jar file resides).
You can customize the location of this directory by setting a configprop:spring.jta.log-dir[] property in your `application.properties` file.
Properties starting with `spring.jta.atomikos.properties` can also be used to customize the Atomikos `UserTransactionServiceImp`.
See the {spring-boot-module-api}/jta/atomikos/AtomikosProperties.html[`AtomikosProperties` Javadoc] for complete details.
NOTE: To ensure that multiple transaction managers can safely coordinate the same resource managers, each Atomikos instance must be configured with a unique ID.
By default, this ID is the IP address of the machine on which Atomikos is running.
To ensure uniqueness in production, you should configure the configprop:spring.jta.transaction-manager-id[] property with a different value for each instance of your application.
[[io.jta.javaee]]
=== Using a Java EE Managed Transaction Manager
If you package your Spring Boot application as a `war` or `ear` file and deploy it to a Java EE application server, you can use your application server's built-in transaction manager.
[[io.jta.jakartaee]]
=== Using a Jakarta EE Managed Transaction Manager
If you package your Spring Boot application as a `war` or `ear` file and deploy it to a Jakarta EE application server, you can use your application server's built-in transaction manager.
Spring Boot tries to auto-configure a transaction manager by looking at common JNDI locations (`java:comp/UserTransaction`, `java:comp/TransactionManager`, and so on).
If you use a transaction service provided by your application server, you generally also want to ensure that all resources are managed by the server and exposed over JNDI.
When using a transaction service provided by your application server, you generally also want to ensure that all resources are managed by the server and exposed over JNDI.
Spring Boot tries to auto-configure JMS by looking for a `ConnectionFactory` at the JNDI path (`java:/JmsXA` or `java:/XAConnectionFactory`), and you can use the <<data#data.sql.datasource.jndi, configprop:spring.datasource.jndi-name[] property>> to configure your `DataSource`.
@@ -65,10 +47,8 @@ include::{docs-java}/io/jta/mixingxaandnonxaconnections/xa/MyBean.java[tag=*]
[[io.jta.supporting-alternative-embedded-transaction-manager]]
=== Supporting an Alternative Embedded Transaction Manager
The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionFactoryWrapper`] and {spring-boot-module-code}/jdbc/XADataSourceWrapper.java[`XADataSourceWrapper`] interfaces can be used to support alternative embedded transaction managers.
[[io.jta.supporting-embedded-transaction-manager]]
=== Supporting an Embedded Transaction Manager
The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionFactoryWrapper`] and {spring-boot-module-code}/jdbc/XADataSourceWrapper.java[`XADataSourceWrapper`] interfaces can be used to support embedded transaction managers.
The interfaces are responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the distributed transaction.
DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`.
The {spring-boot-module-code}/jta/atomikos/AtomikosXAConnectionFactoryWrapper.java[AtomikosXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/atomikos/AtomikosXADataSourceWrapper.java[AtomikosXADataSourceWrapper] provide good examples of how to write XA wrappers.