The XA_COMMIT function commits the global transaction specified in the xid parameter.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
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 this parameter is set to TRUE, one-phase commit is used. |
Return values
For more information, see Possible constant return values for DBMS_XA.
The possible error codes are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, and XAER_PROTO. Other possible return values are XA_OK, XA_RB*, XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, and XA_HEURMIX.
Considerations
Applications cannot call
COMMIT. They must callXA_COMMITto commit the global transaction specified byxid.If
onePhaseis set toTRUE, the resource manager (RM) uses a one-phase commit protocol to commit work done on behalf ofxid. Otherwise,XA_COMMITcan only be called after all branches of the global transaction are prepared and the previous call toXA_PREPAREreturnsXA_OK.An application must call
XA_COMMITseparately for each transaction branch of the global branch for whichXA_PREPAREreturnsXA_OK.If the RM did not commit the transaction and
onePhaseis set toTRUE, the RM may return one of theXA_RB*codes. At this point, the RM has rolled back the branch’s work and has released all resources held.