Hybrid concurrency control
AssigneeHewlett Packard Enterprise Development LP
InventorsTianzheng Wang, Hideaki Kimura
Life of this patent
Estimating the term…
Abstract
Hybrid concurrency control in a database transaction is disclosed. A contention value associated with a database object is read. The contention value is dynamically updated based on access patterns of the database object. If the contention value indicates the database object is under high contention, a pessimistic concurrency control mechanism is applied to the database object. An optimistic concurrency control mechanism is applied to the database object if the contention value does not indicate the database object is under high contention.
Claims19
A computer-implemented method of hybrid concurrency control for database transactions, the method comprising:
- accessing a database object stored in a database, wherein the database comprises a plurality of database objects including the database object and a contention value, and wherein the contention value is dynamically updated based on at least one database transaction of the database transactions;
- initiating an attempted transaction to read the contention value associated with the database object stored in the database;
- when the contention value indicates the database object is under high contention, applying a pessimistic concurrency control mechanism to the database object, wherein the pessimistic concurrency control mechanism initially applies a lock to the database object to prevent a concurrent update with the attempted transaction to the database object and releases the lock to the database object upon committing the database transaction, and wherein the pessimistic concurrency control mechanism includes a two-phase locking protocol, the two-phase locking protocol comprising an expanding phase and a shrinking phase;
- and
- when the contention value indicates the database object is not under high contention, applying an optimistic concurrency control mechanism to the database object.
A non-transitory computer readable medium for storing computer executable instructions for controlling a computing device to perform a method of hybrid concurrency control for database transactions, the method comprising:
- accessing a database object stored in a database, wherein the database comprises a plurality of database objects including the database object and a contention value, and wherein the contention value is dynamically updated based on at least one database transaction of the database transactions;
- initiating an attempted transaction to read the contention value associated with the database object stored in the database;
- when the contention value indicates the database object is under high contention, applying a pessimistic concurrency control mechanism to the database object, wherein the pessimistic concurrency control mechanism initially applies a lock to the database object to prevent a concurrent update with the attempted transaction to the database object and releases the lock to the database object upon committing the database transaction, and wherein the pessimistic concurrency control mechanism includes a two-phase locking protocol, the two-phase locking protocol comprising an expanding phase and a shrinking phase;
- and
- when the contention value indicates the database object is not under high contention, applying an optimistic concurrency control mechanism to the database object.
A system to apply hybrid concurrency control for database transactions, the system comprising:
- a processor;
- and
- a memory comprising instructions executable by the processor to:
- access a database object stored in a database, wherein the database comprises a plurality of database objects including the database object and a contention value, and wherein the contention value is dynamically updated based on at least one database transaction of the database transactions;
- initiate an attempted transaction to read the contention value stored with the database object stored in the database;
- when the contention value indicates the database object is under high contention, apply a pessimistic concurrency control mechanism to the database object, wherein the pessimistic concurrency control mechanism initially applies a lock to the database object to prevent a concurrent update with the attempted transaction to the database object and releases the lock to the database object upon committing the database transaction, and wherein the pessimistic concurrency control mechanism includes a two-phase locking protocol, the two-phase locking protocol comprising an expanding phase and a shrinking phase;
- and
- when the contention value indicates the database object is not under high contention, apply an optimistic concurrency control mechanism to the database object.
Dependencies are inferred from the claim text.