# US 2018/0322156 A1 · Atomic processing of compound database transactions that modify a metadata entity

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

- Number: US 2018/0322156 A1
- Document ID: US20180322156A1
- Status: Published application
- Kind: A1
- Application number: 15/589,740
- Filed: 2017-05-08
- Published: 2018-11-08
- Earliest claimed: 2017-05-08
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Juchang Lee; Joo Yeon Lee; Michael Muehle; Myung Sun Park; Hyoung Jun Na
- Web page: https://patentgrep.com/patent/US20180322156A1

## CPC

- G06F 16/2322: {using timestamps}
- G06F 9/466: {Transaction processing}
- G06F 15/167: using a common memory, e.g. mailbox
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/23: Updating
- G06F 16/2308: {Concurrency control (transaction processing G06F9/466)}
- G06F 16/2329: {using versioning}
- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Technologies are described for facilitating transaction processing within a database environment. A commit protocol provides for the atomic commit or rollback of a transaction that includes an operation that modifies a metadata entity of the database system and one or more other operations that modify metadata entities or data records of the database system. Innovations are provided for detecting and resolving deadlocks that may arise during transaction processing. Innovations are also provided for providing versioning of metadata entities, including invalidating metadata entities cached at a slave node during the commit at a master node of a transaction that creates a new version of the metadata entity.

## Claims

### Claim 1

A method, implemented in a database environment, for facilitating database transactions comprising a statement that modifies metadata information for a database system and at least one of one or more additional statements that modify information for the database system and one or more statements that modify data records for the database system, the method comprising:
initiating transaction for a database client;
in the transaction, executing a first statement that modifies a metadata entity of the database system;
in the transaction, executing at least a second statement, the at least a second statement modifying a metadata entity of the database system or modifying at least one data record for the database system;
receiving a request from the database client to abort or commit the transaction; and
atomically committing or aborting the first and second statements, as specified by the request.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first statement is a DDL statement.

### Claim 3 (depends on 2)

The method of claim 2, wherein the second statement is a DDL statement or a DML statement.

### Claim 4 (depends on 1)

The method of claim 1, further comprising maintaining lock information for any statements in the transaction that modify metadata information for the database system, the lock information comprising an identifier for one or more tables locked in the transaction and an identifier for the transaction.

### Claim 5 (depends on 4)

The method of claim 4, further comprising analyzing the lock information to determine whether a deadlock exists.

### Claim 6 (depends on 1)

The method of claim 1, wherein the transaction is atomically committed, the atomic commit comprising assigning a commit identifier to the first and second statements, wherein the first or second statements are not visible to other database clients until the commit identifier has been assigned.

### Claim 7 (depends on 1)

The method of claim 1, wherein the first statement modifies a first version of a database metadata entity and executing the first statement comprises creating a second version of the metadata entity.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
writing operations associated with the first and second statements to an undo log; and
if the request is to abort the transaction, reading the undo log and undoing changes to the database system made by the first and second statements.

### Claim 9 (depends on 1)

The method of claim 1, wherein executing the first statement comprises registering a callback, the callback being associated with one or more methods to undo changes to the database system made by the first statement.

### Claim 10 (depends on 9)

The method of claim 9, wherein the request is to abort the transaction and the method further comprises executing the callback.

### Claim 11 (depends on 1)

The method of claim 1, wherein the first and second statements are executed at different database nodes.

### Claim 12 (depends on 1)

The method of claim 1, the method further comprising:
receiving a request to read database data, the database data comprising data associated with a table associated with the first statement;
assigning a snapshot timestamp value to the request;
comparing the snapshot timestamp value to version timestamps of a plurality of versions of a metadata entity modified by the first statement; and
selecting a version of the metadata entity having the largest version timestamp that is less than or equal to the snapshot timestamp value.

### Claim 13 (depends on 1)

The method of claim 1, wherein the request is a request to commit the transaction and the method further comprises:
determining one or more nodes maintaining a cached copy of a metadata entity modified by the first statement;
assigning a version identifier to the modified metadata entity; and
sending the version identifier to one or more worker nodes.

### Claim 14 (depends on 1)

The method of claim 1, wherein the request is a request to commit the transaction and the method further comprises:
sending a request to a slave node to mark a metadata entity modified by the first statement as precommitted;
receiving a request to read the metadata entity;
delaying the request to read the metadata entity until the metadata entity is marked as committed or aborted; and
determining a version of the metadata entity to be provided in response to the request to read the metadata entity.

### Claim 15

A server comprising a processing unit and memory, wherein the server is configured to operate a coordinator node of a database system, the coordinator node being in communication with one or more worker nodes, wherein the server is further configured to perform a method for facilitating database transaction processing within a database environment, the method comprising:
receiving a database transaction that includes an operation to modify or delete a metadata entity of the database system;
creating an updated version of the metadata entity;
assigning a version timestamp to the updated version;
sending the version timestamp to at least one of the one or more worker nodes, wherein the version timestamp invalidates a cached version of the metadata entity stored at the at least one worker node; and
committing the database transaction.

### Claim 16 (depends on 15)

The server of claim 15, wherein the sending occurs before the committing.

### Claim 17 (depends on 15)

The server of claim 15, wherein the operation comprises a DDL statement.

### Claim 18 (depends on 15)

The server of claim 15, wherein the transaction further comprises at least one of another operation that modifies metadata of the database system and an operation that modifies at least one record of the database system.

### Claim 19 (depends on 15)

The server of claim 15, wherein the transaction comprises at least one operation executable at the coordinator node and at least one operation executable on at least one of the worker nodes.

### Claim 20

One or more tangible computer-readable storage media storing computer-executable instructions for causing a server programmed thereby to perform a method for facilitating database transaction processing within a database environment using data manipulation language (DML) statements and data definition language (DDL) statements and implementing a coordinator node of a database system, the coordinator node being in communication with at least one worker node, the method comprising:
receiving a transaction from a database client comprising a first DDL statement and at least one of at least a first DML statement and at least a second DDL statement, wherein the first DDL statement modifies or deletes a metadata entity of the database system, the metadata entity being a first version associated with a first version timestamp;
creating a second version of the metadata entity in response to the first DDL statement;
assigning a second version timestamp to the second version of the metadata entity; and
committing the transaction;
wherein the first and second versions are concurrently maintained on the server for a time period.
