Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do I use XA datasource and 2 phase commit

Can someone please explain the use of XA dataSource and how transaction management works in an XA datasource ? How is XA datasouce and 2 Phase commit related?

like image 338
Aravind A Avatar asked Oct 09 '22 05:10

Aravind A


1 Answers

Two-phase commit and XA are more or less synonyms. They ensure that the ACIDity of a transaction is preserved even if this transaction involves several transactional systems such as, for example

  • two databases
  • a database and a JMS engine

To be able to participate in such a global transaction, each datasource must collaborate with the XA transaction manager, and must thus implement the XA protocol. If you need two-phase commit, you thus need an XA datasource.

like image 50
JB Nizet Avatar answered Oct 13 '22 10:10

JB Nizet