OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilot

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilot
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

Embedded SQL in C for OceanBase

V1.1.7Enterprise Edition
  • What's New
  • What is ECOB?
  • ECOB compatibility with Pro*C
  • Install ECOB
  • Data types and variables
    • Overview
    • Supported data types
    • Data type conversion
    • Indicator variable
    • VARCHAR variable
    • Structure
    • String pointer
  • Embedded SQL statements
    • Overview
    • Variable declaration
    • Connect to OceanBase databases
    • Basic SQL statements
    • Prepared statements
    • Stored procedures
    • Cursor
    • Simple dynamic SQL statement
    • ANSI dynamic SQL statements
    • Error handling
      • SQLCA structure
      • WHENEVER statement
    • LOB-related SQL statements
  • Use ECOB
    • Environment preparation
    • Use ECOB
    • Compile the Tuxedo service
  • Command Line Options

Download PDF

Document Feedback
  1. Documentation Center
  2. Embedded SQL in C for OceanBase
  3. V1.1.7

Compile the Tuxedo service

Last Updated:2026-09-04 08:37:38

Process XA transactions
Configure Tuxedo to use OceanBase XA
Configure the resource manager
Build the transaction manager service
Configure UBBCONFIG GROUPS
Compile the application service

Process XA transactions

OceanBase implements the eXtended Architecture (XA) distributed transaction interface, which can be used in the X/Open distributed transaction processing (DTP) environment. Based on the XA interface, a distributed transaction manager, for example, Oracle Tuxedo, can use OceanBase Database as a resource manager. In XA transactions, the transaction manager uses the two-phase commit protocol to commit global transactions.

Developers who use the Tuxedo service usually write the business code in C language that contains the embedded SQL statements. ECOB enables you to precompile .pc files and then compile and link the files to the Tuxedo service.

Configure Tuxedo to use OceanBase XA

This section describes how to set OceanBase as a resource manager in Tuxedo. For more information about Tuxedo, see the official documentation of Tuxedo.

Configure the resource manager

Open the $TUXDIR/udataobj/RM configuration file, and add a row of OceanBase XA resource manager named OB_XA.

OB_XA:xaosw:-L/u01/obclient/lib -L/usr/local/lib64 -lobci -lobclnt -lecob

Build the transaction manager service

Run the buildtms command of Tuxedo to build a transaction manager service (TMS) for OceanBase XA resource manager.

buildtms -o TMS_OB -r OB_XA -v
cp TMS_OB $TUXDIR/bin

Configure UBBCONFIG GROUPS

In the UBBCONFIG configuration file of the Tuxedo runtime, add the following OPENINFO in all services and groups that use OceanBase Database.

OPENINFO="OB_XA:OB_XA+Acc=P/MyUser@MyTenant/MyPassword+SqlNet=MyTnsName+SesTm=60+DbgFl=15+LogDir=."

Compile the application service

Run the buildserver command of Tuxedo to compile your Application-to-Transaction Monitor Interface (ATMI) service application. In the buildserver command, the -r parameter specifies the resource manager name in the RM file.

buildserver -r OB_XA

Previous topic

Use ECOB
Last

Next topic

Command Line Options
Next
on this page
Process XA transactions
Configure Tuxedo to use OceanBase XA
Configure the resource manager
Build the transaction manager service
Configure UBBCONFIG GROUPS
Compile the application service