# US 2021/0081429 A1 · Transaction savepoint management apparatus and method for distributed database

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0081429 A1
- Document ID: US20210081429A1
- Status: Published application
- Kind: A1
- Application number: 16/620,060
- Filed: 2018-06-01
- Published: 2021-03-18
- Earliest claimed: 2017-06-12
- Assignees: China Unionpay Co., Ltd.
- Applicants: China UnionPay Co., Ltd.
- Inventors: Jiajing ZHOU; Qingshun LUO; Chenguang PEI; Hao MIAO; Huabei SHI
- Web page: https://patentgrep.com/patent/US20210081429A1

## CPC

- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Proposed are a transaction savepoint management apparatus and method, which may involve: creating, based on a transaction initiation request from a user terminal, a transaction, wherein the transaction includes a plurality of operation instructions, and subsequently accessing at least one of a plurality of databases so as to sequentially execute the plurality of operation instructions according to a time sequence; and if the plurality of operation instructions includes global savepoint establishment instruction, creating and maintaining a global savepoint queue to coordinate the plurality of databases and implement an operation for global savepoints, and based on the global savepoints, triggering a database, involved in this transaction, from among the plurality of databases to establish local savepoints and record an association relationship between each of the local savepoints and the global savepoints. The apparatus and method disclosed in the present invention can be used for transaction savepoint management for a distributed database.

## Claims

### Claim 1

A transaction savepoint management apparatus, comprising at least a control unit configured to create, based on a transaction initiation request received from a user terminal, a transaction comprising a plurality of operational instructions, and access at least one of a plurality of databases to sequentially execute the plurality of operational instructions in time sequence, wherein if the plurality of operational instructions comprise a global savepoint establishment instruction, the control unit is further configured to create and maintain a global savepoint queue so as to coordinate the plurality of databases to implement operations directed to a global savepoint, wherein the control unit is further configured to trigger, based on the global savepoint, a database involved in the transaction from among the plurality of databases to establish a local savepoint, and record an association relationship between each local savepoint and the global savepoint.

### Claim 2 (depends on 1)

The transaction savepoint management apparatus according to claim 1, further comprising a savepoint establishment unit configured to execute a global savepoint establishment operation as driven by the control unit, wherein the global savepoint establishment operation comprises: creating the global savepoint and recording the global savepoint in the global savepoint queue, and setting the global savepoint as a latest global savepoint; checking a state of a current local savepoint of each database involved in the transaction; and if the current local savepoint of a database is in a stable state, associating the current local savepoint in the stable state with the global savepoint, otherwise, notifying the database to create a new local savepoint and associating the new local savepoint with the global savepoint.

### Claim 3 (depends on 2)

The transaction savepoint management apparatus according to claim 2, further comprising a savepoint rollback unit configured to execute a global savepoint rollback operation as driven by the control unit, wherein the global savepoint rollback operation comprises: if the current local savepoint of a database involved in the transaction is in the stable state and is required to be rolled back to the local savepoint associated with an object global savepoint to which the global savepoint rollback operation is directed, not triggering the database to execute a local savepoint rollback operation, and deleting only the association relationship between each global savepoint after the object global savepoint and the local savepoint; otherwise, triggering the database to execute the local savepoint rollback operation to roll back to the local savepoint associated with the object global savepoint, deleting the association relationship between each global savepoint after the object global savepoint and the local savepoint, and deleting all the global savepoints after the object global savepoint in time sequence.

### Claim 4 (depends on 3)

The transaction savepoint management apparatus according to claim 3, further comprising a savepoint release unit configured to execute a global savepoint release operation as driven by the control unit, wherein the global savepoint release operation comprises: deleting the association relationship between the global savepoint to be deleted and the local savepoint of each database involved, and deleting the global savepoint from the global savepoint queue; and checking whether the local savepoint in each database involved has the association relationship with any other global savepoint, and triggering a database involved to execute a local savepoint release operation if the local savepoint of the database has no association relationship with any other global savepoint.

### Claim 5 (depends on 4)

The transaction savepoint management apparatus according to claim 4, wherein, when a database involved in the transaction is accessed for the first time to execute a related operational instruction, the database first establishes a subtransaction and execute the related operational instruction.

### Claim 6 (depends on 5)

The transaction savepoint management apparatus according to claim 5, further comprising a savepoint reset unit configured to execute a global savepoint reset operation as driven by the control unit, wherein the global savepoint reset operation comprises: setting a location, of the global savepoint to be reset, in time sequence as latest; resetting, if a current local savepoint of a database involved in the transaction is in a stable state, the local savepoint of the database associated with the global savepoint as the current local savepoint in the stable state; and executing a local savepoint reset operation, if the local savepoint of the database associated with the global savepoint is not associated with any other global savepoint, and the database has no local savepoint in the stable state or the local savepoint in the stable state is not associated with the global savepoint.

### Claim 7 (depends on 6)

The transaction savepoint management apparatus according to claim 6, wherein the control unit is further configured to trigger each database involved to release the local savepoint that is not associated with any global savepoint.

### Claim 8 (depends on 7)

The transaction savepoint management apparatus according to claim 7, wherein the control unit is further configured to, when a new database needs to be added to execute the transaction, trigger, if there has been a global savepoint, the new database to establish at least one local savepoint, and associate the at least one local savepoint with the global savepoint.

### Claim 9

A transaction savepoint management method, comprising: creating, based on a transaction initiation request from a user terminal, a transaction comprising a plurality of operational instructions, and accessing at least one of a plurality of databases to sequentially execute the plurality of operational instructions in time sequence; if the plurality of operational instructions comprise a global savepoint establishment instruction, creating and maintaining a global savepoint queue so as to coordinate the plurality of databases to implement operations directed to a global savepoint, triggering, based on the global savepoint, a database involved in the transaction from among the plurality of databases to establish a local savepoint, and recording an association relationship between each local savepoint and the global savepoint.
