XaTransaction.commit

Commits a distributed transaction (managed by xa_trans). The commit is composed of two phases: <itemizedlist> <listitem><para>a PREPARE phase where all the connections are required to store their transaction data to a permanent place (to be able to complete the commit should a problem occur afterwards)</para></listitem> <listitem><para>a COMMIT phase where the transaction data is actually written to the database</para></listitem> </itemizedlist>

If the PREPARE phase fails for any of the connection registered with xa_trans, then the distributed commit fails and FALSE is returned. During the COMMIT phase, some commit may actually fail but the transaction can still be completed because the PREPARE phase succeeded (through the recover method).

class XaTransaction
bool
commit

Parameters

cncToRecover gda.connection.Connection[]

a place to store the list of connections for which the commit phase failed, or null

Return Value

Type: bool

TRUE if no error occurred (there may be some connections to recover, though)

Throws