Rechercher dans le manuel MySQL
13.3.8.2 XA Transaction States
An XA transaction progresses through the following states:
Use
XA STARTto start an XA transaction and put it in theACTIVEstate.For an
ACTIVEXA transaction, issue the SQL statements that make up the transaction, and then issue anXA ENDstatement.XA ENDputs the transaction in theIDLEstate.For an
IDLEXA transaction, you can issue either anXA PREPAREstatement or anXA COMMIT ... ONE PHASEstatement:XA PREPAREputs the transaction in thePREPAREDstate. AnXA RECOVERstatement at this point will include the transaction'sxidvalue in its output, becauseXA RECOVERlists all XA transactions that are in thePREPAREDstate.XA COMMIT ... ONE PHASEprepares and commits the transaction. Thexidvalue will not be listed byXA RECOVERbecause the transaction terminates.
For a
PREPAREDXA transaction, you can issue anXA COMMITstatement to commit and terminate the transaction, orXA ROLLBACKto roll back and terminate the transaction.
Here is a simple XA transaction that inserts a row into a table as part of a global transaction:
- Query OK, 0 rows affected (0.00 sec)
- Query OK, 1 row affected (0.04 sec)
- Query OK, 0 rows affected (0.00 sec)
- mysql> XA PREPARE 'xatest';
- Query OK, 0 rows affected (0.00 sec)
- Query OK, 0 rows affected (0.00 sec)
Within the context of a given client connection, XA transactions
and local (non-XA) transactions are mutually exclusive. For
example, if XA
START has been issued to begin an XA transaction, a
local transaction cannot be started until the XA transaction has
been committed or rolled back. Conversely, if a local
transaction has been started with
START
TRANSACTION, no XA statements can be used until the
transaction has been committed or rolled back.
If an XA transaction is in the ACTIVE state,
you cannot issue any statements that cause an implicit commit.
That would violate the XA contract because you could not roll
back the XA transaction. You will receive the following error if
you try to execute such a statement:
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed
when global transaction is in the ACTIVE stateStatements to which the preceding remark applies are listed at Section 13.3.3, “Statements That Cause an Implicit Commit”.
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-xa-states.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.