XA_PREPARE

2026-04-02 06:23:58  Updated

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-compatible 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

An application must keep track of all the branches of a global transaction, and prepare each transaction branch. An application can only call XA_COMMIT after all the branches of a global transaction are prepared and XA_OK is returned by XA_PREPARE for every branch.

Contact Us