What is a global transaction?

JSR 907 JTA 1.2 defines the term "global transaction":

The UserTransaction.begin method starts a global transaction and associates the transaction with the calling thread.

What does it mean? Is it an external transaction or what?

+5
source share
1 answer

Basically, the difference between a local transaction and a global transaction is related to resources. A global transaction will span multiple resources. A local transaction is limited to one resource / data source.

eg.

In a global transaction, you will write to the database and send a message to the queue.

This is well explained here: http://integrationspot.blogspot.co.uk/2011/03/jta-transactions-local-and-global.html

Global Transactions (XA)

When a managed data source is configured for global transactions, it returns connections that can participate in global transactions. A global transaction (also called a distributed transaction) credits more than one resource in a transaction.

Global transactions provide the ability to work with multiple transactional resources (usually relational databases and queue messages).

+4
source

Source: https://habr.com/ru/post/1207789/


All Articles