The XA_START function associates the current session with the transaction branch specified by xid.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_XA.XA_START (
xid IN DBMS_XA_XID,
flag IN PLS_INTEGER)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| xid | See DBMS_XA_XID object type. |
| flag | See DBMS_XA constants |
Return value
See DBMS_XA possible constant return values.
Considerations
If the
TMJOINorTMRESUMEflag is specified in the flag, the existing transaction branch identified byxidis started. When you want to separate a transaction by using theTMSUCCESSflag, use theTMJOINflag. When you want to separate a transaction branch by using theTMSUSPENDflag, use theTMRESUMEflag. You can use either flag to call theXA_STARTfunction to join an existing transaction branch.If the
TMNOFLAGSflag is specified in the flag and theTMJOINandTMRESUMEflags are not specified, a new transaction branch is started. If a transaction branch is specified byxid, theXA_STARTfunction returns theXAER_DUPIDerror code.Possible error return values include:
XAER_RMERR,XAER_RMFAIL,XAER_DUPID,XAER_OUTSIDE,XAER_NOTA,XAER_INVAL, andXAER_PROTO.If the
XA_STARTfunction is executed successfully, it returnsXA_OK. The application must check the return value and handle errors. The PL application should only continue with other operations afterXA_OKis returned. Transaction stacks are not supported. If an active transaction is associated with the current session, the transaction may not be called to start or join another transaction. If you call theXA_STARTfunction by using an active global transaction branch associated with the current session, theXAER_PROTOerror code is returned. If you call theXA_STARTfunction by using a local transaction associated with the current session, theXAER_OUTSIDEerror code is returned.
