Help Center > > Developer Guide> Distributed Transaction Management Development Guide> Connecting to DTM in Non-Intrusive Mode> Connecting Dubbo to DTM> Creating a Transaction Table in the Service Database

Creating a Transaction Table in the Service Database

Updated at: Sep 17, 2021 GMT+08:00

Create the DTM transaction table dtm_tran_info in the service database to record transaction information. You can use either of the following methods to create a DTM transaction table. You are advised to modify the DTM configuration to automatically create a DTM transaction table.

  • Method 1: Change the value of auto-create-table-dtm-tran-info in the dtmClientConfig.properties configuration file to on to enable automatic creation.
    auto-create-table-dtm-tran-info=on
  • Method 2: Manually create a transaction database table based on the original one. The SQL statements are as follows.
    1. If the MySQL or GaussDB(for MySQL) database is used, run the following SQL statements:
      CREATE TABLE dtm_tran_info ( 
        branch_id bigint(20) NOT NULL, 
        global_id bigint(20) NOT NULL, 
        tran_info longblob NOT NULL, 
        info_status int(11) NOT NULL, 
        info_created datetime(0) NOT NULL, 
        ext varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, 
        PRIMARY KEY (branch_id) USING BTREE 
      ) ENGINE = InnoDB AUTO_INCREMENT = 3571 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; 
    2. If the PostgreSQL or GaussDB(openGauss) database is used, run the following SQL statements:
      CREATE TABLE dtm_tran_info (
        branch_id bigint NOT NULL primary key ,
        global_id bigint NOT NULL,
        tran_info text NOT NULL,
        info_status int NOT NULL,
        info_created timestamp NOT NULL,
        ext          varchar(100)
      )

    Create the dtm_tran_info transaction tables in the databases of Bank A and Bank B.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel