9.4.1.2.2 Trade-offs Between Possible Commit Criteria
In most cases, when all participants in a global transaction
have logged successful completion of phase 1, they do not fail to
complete phase 2. By setting CMTRET
to
LOGGED
, you allow a slightly faster return of calls to
tpcommit()
, but you run the slight risk that a
participant may heuristically complete its part of the transaction
in a way that is not consistent with the commit decision.
Whether it is prudent to accept the risk depends to a large extent on the nature of your application. If your application demands complete accuracy (for example, if you are running a financial application), you must probably wait until all participants fully complete the two-phase commit process before returning. If your application is more time-sensitive, you may prefer to have the application execute faster at the expense of accuracy.
Parent topic: Two-phase Commit Protocol