Browse Prior Art Database

Locking Mechanism for Controlling Access to Data Base Resources

IP.com Disclosure Number: IPCOM000061525D
Original Publication Date: 1986-Aug-01
Included in the Prior Art Database: 2005-Mar-09
Document File: 3 page(s) / 16K

Publishing Venue

IBM

Related People

Cheng, JM: AUTHOR [+7]

Abstract

This disclosure relates to a relational data base using locking as a mechanism for controlling access to data base resources. The basic idea of locking is to establish ownership of a resource of interest so that the resource does not change in some unpredictable manner. The locks are acquired at various levels; some are exclusive which allow isolation from uncommitted work, while others allow sharing of a resource. All units of work within contemporary relational data bases are based upon the application, a transaction, and a plan. An application is a program or a set of programs that perform a task.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 41% of the total text.

Page 1 of 3

Locking Mechanism for Controlling Access to Data Base Resources

This disclosure relates to a relational data base using locking as a mechanism for controlling access to data base resources. The basic idea of locking is to establish ownership of a resource of interest so that the resource does not change in some unpredictable manner. The locks are acquired at various levels; some are exclusive which allow isolation from uncommitted work, while others allow sharing of a resource. All units of work within contemporary relational data bases are based upon the application, a transaction, and a plan. An application is a program or a set of programs that perform a task. A transaction is a unit of work which begins when the application establishes communication with the data base (called allocation) and ends when the application considers the data is consistent (called commit), when the data changed by the application is to be restored (called rollback), or when the application breaks communication with a relational data base (called deallocation). A plan is a set of capabilities of an application. The plan is created by a relational data base when the application is bound (or registered). Applications bound to a relational data base containing all query language statements that will be used during its execution are called static applications. Applications bound to a relational data base where the query language statements used by it are known only during execution are called dynamic applications. The invention takes advantage of the fact that all query language statements executed by a static application are known by acquiring locks on all resources referenced at allocation and releasing those locks at deallocation. The object is to lock all resources that are needed by an application before work begins to minimize the amount of work that must be undone if a resource is unavailable. The locks are acquired in a consistent sequence, thereby minimizing deadlocks between other applications being allocated. A relational data base chooses the highest (or most restrictive) level lock necessary for the execution of all query language statements within the application referencing the resource. For example, if a query language statement within the application allows a resource to be shared, while another query language statement within the application requires exclusive use of the resource, the lock acquired at allocation is the highest one - namely, the one which exclusively locks the resource. Since the resources required by a dynamic application are unpredictable, locks for dynamic applications executing in a relational data base are acquired on a resource when a query language statement referencing the resource is executed, and are released when a commit or rollback is processed. No resources are locked at allocation. The level lock chosen by a relational data base is that which is necessary for the execution of the query language statement cu...