7.6.2 About Global and Local Transactions
When a transaction initiator service makes a call to MicroTx to begin an XA transaction, by default this transaction is handled as a global transaction.
Global transaction is a transaction that is associated with a GTRID. For example, transactions that span across multiple microservices or transactions that involve a single microservice interacting with multiple resource managers.
Local transaction is a transaction that is not associated with a GTRID. For example, when a transaction includes a single service that interacts with a single resource manager. Such transactions can be handled locally, as you don't need a coordinator to manage this transaction. The MicroTx client library manages the local transactions. By handling a transaction locally, without using the MicroTx coordinator, you can experience better performance. Local transactions save time and increase throughput.
- About MicroTx Client Library Annotations
Based on the context in which a participant service is called, the service participates in a local or global XA transaction. - About Transaction Promotion
When you enable the transaction promotion feature, every transaction is initiated as a local transaction. - Enable Transaction Promotion
By default, all transactions are associated with a global transaction ID (GTRID) and handled as a global transaction. To experience better performance, enable transaction promotion to manage certain transactions.
Parent topic: Manage XA Transactions