# US 2014/0156619 A1 · Locking Protocol for Partitioned and Distributed Tables

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

- Number: US 2014/0156619 A1
- Document ID: US20140156619A1
- Status: Published application
- Kind: A1
- Application number: 13/750,194
- Filed: 2013-01-25
- Published: 2014-06-05
- Earliest claimed: 2012-11-30
- Assignees: Sap SE
- Inventors: Juchang LEE; Jin Yeon Lee; Yongjae Chuh; Jaeyun Noh
- Web page: https://patentgrep.com/patent/US20140156619A1

## CPC

- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/2308: {Concurrency control (transaction processing G06F9/466)}
- 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

Systems, methods and computer program product embodiments for providing a locking protocol for partitioned and distributed database tables are disclosed herein. A locking method includes executing, by at least one processor, a first database transaction on a second node, attempting to acquire and acquiring a lock on the second node in intentional exclusive mode, executing, by the at least one processor, a second database transaction on a first node, acquiring a lock on the first node in exclusive mode and waiting to acquire a lock on the second node in exclusive mode, routing, by the at least one processor, the first database transaction to the first node and unsuccessfully trying to acquire a lock on the first node and committing, by the at least one processor, the first database transaction.

## Claims

### Claim 1

A method, comprising:
executing, by at least one processor, a first database transaction on a second node, attempting to acquire and acquiring a lock on the second node in intentional exclusive mode;
executing, by the at least one processor, a second database transaction on a first node, acquiring a lock on the first node in exclusive mode and waiting to acquire a lock on the second node in exclusive mode;
routing, by the at least one processor, the first database transaction to the first node and unsuccessfully trying to acquire a lock on the first node; and
committing, by the at least one processor, the first database transaction.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first database transaction is a data manipulation language (DML) transaction.

### Claim 3 (depends on 1)

The method of claim 1, wherein the second database transaction is a data definition language (DDL) transaction.

### Claim 4 (depends on 1)

The method of claim 1, farther comprising:
determining that the second node is locked in intentional exclusive mode before committing the first database transaction.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
skipping locking the first node by the first database transaction.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
executing a third database transaction on the first node and unsuccessfully trying to acquire a lock on the first node.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
executing a fourth database transaction on the second node and unsuccessfully trying to acquire a lock on the second node.

### Claim 8

A system, comprising:
random access memory configured to store a database; and
at least one processor configured to:
execute a first database transaction on a second node, attempt to acquire and acquire a lock on the second node in intentional exclusive mode;
execute a second database transaction on a first node, acquire a lock on the first node in exclusive mode and wait to acquire a lock on the second node in exclusive mode;
route the first database transaction to the first node and unsuccessfully try to acquire a lock on the first node; and
commit the first database transaction.

### Claim 9 (depends on 8)

The system of claim 8, wherein the first database transaction is a data manipulation language (DML) transaction.

### Claim 10 (depends on 8)

The system of claim 8, wherein the second database transaction is a data definition language (DDL) transaction.

### Claim 11 (depends on 8)

The system of claim 8, the at least one processor further configured to:
determine that the second node is locked in intentional exclusive mode before committing the first database transaction.

### Claim 12 (depends on 11)

The system of claim 11, the at least one processor further configured to:
skip locking the first node by the first database transaction.

### Claim 13 (depends on 8)

The system of claim 8, the at least one processor further configured to:
execute a third database transaction on the first node and unsuccessfully try to acquire a lock on the first node.

### Claim 14 (depends on 8)

The system of claim 8, the at least one processor further configured to:
execute a fourth database transaction on the second node and unsuccessfully try to acquire a lock on the second node.

### Claim 15

A computer-readable device having instructions stored thereon, execution of which, by at least one computing device, causes the at least one computing device to perform operations comprising:
executing a first database transaction on a second node, attempting to acquire and acquiring a lock on the second node in intentional exclusive mode;
executing a second database transaction on a first node, acquiring a lock on the first node in exclusive mode and waiting to acquire a lock on the second node in exclusive mode;
routing the first database transaction to the first node and unsuccessfully trying to acquire a lock on the first node; and
committing the first database transaction.

### Claim 16 (depends on 15)

The computer-readable device of claim 15, wherein the first database transaction is a data manipulation language (DML) transaction and the second database transaction is a data definition language (DDL) transaction.

### Claim 17 (depends on 15)

The computer-readable device of claim 15, the operations further comprising:
determining that the second node is locked in intentional exclusive mode before committing the first database transaction.

### Claim 18 (depends on 17)

The computer-readable device of claim 17, the operations further comprising:
skipping locking the first node by the first database transaction.

### Claim 19 (depends on 15)

The computer-readable device of claim 15, the operations further comprising:
executing a third database transaction on the first node and unsuccessfully trying to acquire a lock on the first node.

### Claim 20 (depends on 15)

The computer-readable device of claim 15, the operations further comprising:
executing a fourth database transaction on the second node and unsuccessfully trying to acquire a lock on the second node.

### Claim 21

A method, comprising:
attempting, by at least one processor, an intentional exclusive lock for a local database node having a partition of a database table; and
determining, by the at least one processor, that the trying failed and determining whether a remote database node having another partition of the database table has acquired an intentional exclusive lock and acquiring the intentional exclusive lock for the another portion of the database table if not acquired.

### Claim 22 (depends on 21)

The method of claim 21, further comprising:
skipping locking the intentional exclusive lock for the another portion of the database table if acquired.
