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 values
For more information, see Possible constant return values for DBMS_XA.
The possible return values are XA_OK, XA_RDONLY, XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, and XAER_PROTO.
Considerations
If you need to prepare a transaction branch created by other users, you must be first granted the
FORCE ANY TRANSACTIONprivilege.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.