Documentation Home
Connectors and APIs Manual
Download this Manual mysqlnd_ms_xa_commit

Copyright 1997-2018 the PHP Documentation Group.

  • mysqlnd_ms_xa_commit

    Commits a distributed/XA transaction among MySQL servers


int mysqlnd_ms_xa_commit(mixed connection,
                         string gtrid);

Commits a global transaction among MySQL servers started by mysqlnd_ms_xa_begin.

If any of the global transaction participants fails to commit an implicit rollback is performed. It may happen that not all cases can be handled during the rollback. For example, no attempts will be made to reconnect to a participant after the connection to the participant has been lost. Solving cases that cannot easily be rolled back is left to the garbage collection.


The feature is currently under development. There may be issues and/or feature limitations. Do not use in production environments.



A MySQL connection handle obtained from any of the connect functions of the mysqli, mysql or PDO_MYSQL extensions.


Global transaction identifier (gtrid).

Return Values

Returns TRUE if the global transaction has been committed. Otherwise, returns FALSE

See Also

Quickstart XA/Distributed transactions
Runtime configuration