OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.5

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.5
    iconOceanBase Database
    SQL - V 4.2.5
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    XA_END

    Last Updated:2026-04-27 03:14:13  Updated
    share
    What is on this page
    Syntax
    Parameters
    Return values
    Considerations

    folded

    share

    The XA_END function disassociates the current session from the transaction branch specified in xid.

    The transaction manager calls XA_END when a control thread completes a transaction branch or needs to suspend the work on a transaction branch. This occurs when the application completes a part or all of its work. For example, XA_END is called before blocking some event to enable other control threads to work on the branch. After XA_END returns with success, the calling control thread is no longer associated with the branch, but the branch still exists.

    Applicability

    This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

    Syntax

    DBMS_XA.XA_END (
       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 for the flag field of XA_START & XA_END.

    Return values

    For more information, see Possible constant return values for DBMS_XA.

    The possible error codes are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL, XAER_PROTO, and XA_RB*.

    Considerations

    • You can specify TMSUCCESS or TMSUSPEND in the flag parameter, and the transaction branch is disassociated from the current session in the detached state if the return value is XA_OK. TMFAIL is not supported. You can call XA_END with TMSUCCESS or TMSUSPEND to disassociate the transaction branch specified by xid from the current session.

    • If XA_END succeeds, XA_OK is returned. An application must check the return value and handle error cases. The application can only proceed with other normal operations when XA_OK is returned.

    • If you execute a ROLLBACK statement before XA_END is called, changes made by the current transaction will be rolled back. However, the context of the transaction is till associated with the current session until you call XA_END.

    • If you execute a COMMIT statement before XA_END is called, the following error will be returned: ORA-02089: COMMIT is not allowed in a subordinate session.

    • If you execute a COMMIT or ROLLBACK statement after XA_END is called, the execution does not have any effect on the transaction specified by xid because it is no longer associated with the current session. In this case, you can commit the transaction ID or call the XA_ROLLBACK function to commit or rollback the transaction specified by xid.

    Previous topic

    XA_COMMIT
    Last

    Next topic

    XA_FORGET
    Next
    What is on this page
    Syntax
    Parameters
    Return values
    Considerations