XA is the Distributed transaction Processing specification proposed by Open Group, JTA supports XA specification, JTA only specifies interfaces, some application containers provide implementations, and some three-party open source implementations are available, such as Atomikos.
If PostgreSQL participates in Distributed transaction (XA) processing, you need to set the Max_prepared_transactions parameter in configuration file postgres.conf, which is used to specify the maximum number of two-step commit preparation transactions in a distributed transaction. The default value is 0, and distributed transactions are not supported at this time.
The max_prepared_transactions parameter value should not be less than the Max_connections parameter value, so that each session can have at least one prepared transaction available.
12 |
max_connections = 100 max_prepared_transactions = 100 |
If you have a standby server, both parameter values on the standby server cannot be smaller than the corresponding values on the master server.
"Go" PostgreSQL Distributed transaction Configuration