#docslug#/ecob/ecob/V1.1.6/bygbea
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