The XA_PREPARE function prepares the transaction branch specified in xid for committing.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_XA.XA_PREPARE (
xid IN DBMS_XA_XID)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| xid | For more information, see DBMS_XA_XID object type. |
Return value
For more information, see DBMS_XA constants.
The possible return values are XA_OK, XA_RDONLY, XA_RB\*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, and XAER_PROTO.
Considerations
- An application must keep track of all the branches of a global transaction, and prepare each transaction branch. An application can only call
XA_COMMITafter all the branches of a global transaction are prepared andXA_OKis returned byXA_PREPAREfor every branch.