The XA_COMMIT function is used to commit a global transaction specified by xid.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_XA.XA_COMMIT (
xid IN DBMS_XA_XID,
onePhase IN BOOLEAN)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| xid | For more information, see DBMS_XA_XID object type. |
| onePhase | If the value is TRUE, one-phase commit is applied. |
Return values
For more information, see Possible constant return values of DBMS_XA.
The possible error codes are: XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO. Other possible return values include: XA_OK, XA_RB *, XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, and XA_HEURMIX.
Considerations
Applications must call the
XA_COMMITfunction to commit a global transaction specified byxid. They cannot call theCOMMITfunction.If the
onePhasevalue isTRUE, the resource manager must use a one-phase commit protocol to commit the work specified byxid. Otherwise, theXA_COMMITfunction can be called only after all branches of the global transaction have been successfully completed and the previousXA_PREPAREcall returnedXA_OK.Applications must make separate
XA_COMMITcalls for each transaction branch of a global transaction that returnedXA_OKfrom theXA_PREPAREfunction.If the resource manager did not commit the transaction and the
onePhaseparameter is set toTRUE, the resource manager can return one of theXA_RB *codes. After returning, the resource manager rolls back the work of the branch and releases all reserved resources.
