The XA_START function associates the current session with the transaction branch 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_START (
xid IN DBMS_XA_XID,
flag IN PLS_INTEGER)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| xid | For more information, see DBMS_XA_XID object type. |
| flag | For more information, see DBMS_XA constants. |
Return values
For more information, see Possible constant return values for DBMS_XA.
Considerations
If you specify
TMJOINorTMRESUMEin the flag parameter, the operation starts from an existing transaction branch specified by thexidparameter. Use theTMJOINflag when the transaction is detached with theTMSUCCESSflag. Use theTMRESUMEflag when the transaction branch is detached with theTMSUSPENDflag. Either flag can be used to callXA_STARTto join an existing transaction branch.If you specify
TMNOFLAGSbut do not specify eitherTMJOINorTMRESUMEin the flag parameter, a new transaction branch will be started. If the transaction branch specified byxidalready exists, XA_START returns theXAER_DUPIDerror code.The possible return values when in error are
XAER_RMERR,XAER_RMFAIL,XAER_DUPID,XAER_OUTSIDE,XAER_NOTA,XAER_INVAL, andXAER_PROTO.If
XA_STARTsucceeds,XA_OKis returned. An application must check the return value and handle error cases. The PL application can only proceed with other normal operations whenXA_OKis returned. Transaction stacking is not supported. If an active transaction associated with the current session exists, the function may not be called to start or join another transaction. IfXA_STARTis called with an active global transaction branch associated with the session,XAER_PROTOis returned. IfXA_STARTis called with a local transaction associated with the current session,XAER_OUTSIDEis returned.