All Products
Search
Document Center

Tablestore:CommitTransaction

Last Updated:May 24, 2024

Commits a local transaction. To save data modifications after you create a local transaction based on a specified partition key value and perform read and write operations within the local transaction, you must commit the local transaction.

Usage notes

  • The validity period of a local transaction can be up to 60 seconds.

    If a local transaction is not committed or aborted within 60 seconds, the Tablestore server determines that the local transaction times out and aborts the transaction.

  • If a local transaction is not committed, it may become invalid. In this case, retry the operations in this transaction.

  • If no write operation is performed on the data in a local transaction, the commit and abort operations have the same effect.

Request syntax

message CommitTransactionRequest {
    required string transaction_id = 1;
}

Parameter

Type

Required

Description

transaction_id

string

Yes

The ID of the local transaction.

Response syntax

message CommitTransactionResponse {
};

Use Tablestore SDKs

You can use the following Tablestore SDKs to implement local transactions: