IP Library Granted Patent US 9,501,502
Granted Patent B2
US 9,501,502 · App. 13/750,194 · Granted Nov 22, 2016

Locking protocol for partitioned and distributed tables

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,501,502
App. No.
13/750,194
Granted
Nov 22, 2016
Kind
B2
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 (52)

1. A method, comprising:

beginning, by at least one processor, execution of a first database transaction on a second node,

acquiring a lock on the second node in intentional exclusive mode to perform operations required by the first database transaction;

beginning, 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 to perform operations required by the second database transaction;

routing, by the at least one processor, the first database transaction from the second node to the first node to perform operations required by the first database transaction;

in response to determining that the lock is acquired on the second node, determining that lock acquisition on the first node is not necessary to process the first database transaction on the first node; and

committing, by the at least one processor, the first database transaction.

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

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

4. The method of claim 1 , further comprising:

determining that the second node is locked in intentional exclusive mode before committing the first database transaction.

5. 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.

6. 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.

7. The method of claim 1 , wherein a database table is distributed into a first partition on the first node, and a second partition on the second node.

8. The method of claim 7 , wherein database transactions on the first partition and the second partition may be performed in parallel.

9. The method of claim 1 , further comprising:

determining that the second node is locked in exclusive mode before committing the second database transaction.

10. A system, comprising:

random access memory configured to store a database; and

at least one processor configured to:

begin a first database transaction on a second node in the database, attempt to acquire and acquire a lock on the second node in intentional exclusive mode to perform operations required by the first database transaction;

begin a second database transaction on a first node in the database, acquire a lock on the first node in exclusive mode and wait to acquire a lock on the second node in exclusive mode to perform operations required by the second database transaction;

route the first database transaction from the second node to the first node and try to acquire a lock in intentional exclusive mode on the first node to perform operations required by the first database transaction;

in response to determining that the lock is acquired on the second node, determine that lock acquisition on the first node is not necessary to process the first database transaction on the first node;

and

commit the first database transaction.

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

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

13. The system of claim 10 , 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.

14. The system of claim 10 , 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.

15. The system of claim 10 , 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.

16. 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:

beginning, by at least one processor, execution of a first database transaction on a second node,

acquiring a lock on the second node in intentional exclusive mode to perform operations required by the first database transaction;

beginning, 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 to perform operations required by the second database transaction;

routing, by the at least one processor, the first database transaction from the second node to the first node to perform operations required by the first database transaction;

in response to determining that the lock is acquired on the second node, determining that lock acquisition on the first node is not necessary to process the first database transaction on the first node; and

committing, by the at least one processor, the first database transaction.

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

18. The computer-readable device of claim 16 , the operations further comprising:

determining that the second node is locked in intentional exclusive mode before committing the first database transaction.

19. The computer-readable device of claim 16 , the operations further comprising:

executing a third database transaction on the first node and unsuccessfully trying to acquire a lock on the first node.

20. The computer-readable device of claim 16 , the operations further comprising:

executing a fourth database transaction on the second node and unsuccessfully trying to acquire a lock on the second node.

Assignments (2)
CHANGE OF NAME Recorded Aug 26, 2014
From: SAP AG
To: SAP SE
Reel/Frame 033625/0223 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 29, 2013
From: LEE, JUCHANG; LEE, JIN YEON; CHUH, YONGJAE; NOH, JAEYUN
To: SAP AG
Reel/Frame 029711/0722 →