# US 8,577,908 B2 · Automatic lock management in an abstract database

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

- Number: US 8,577,908 B2
- Document ID: US8577908B2
- Status: Granted
- Kind: B2
- Application number: 10/393,305
- Filed: 2003-03-20
- Published: 2004-09-23
- Granted: 2013-11-05
- Earliest claimed: 2003-03-20
- Assignees: International Business Machines Corporation
- Applicants: Richard D. Dettinger; Frederick A. Kulack; Richard J. Stevens; Eric W. Will
- Inventors: Richard D. Dettinger; Frederick A. Kulack; Richard J. Stevens; Eric W. Will
- Web page: https://patentgrep.com/patent/US8577908B2

## CPC

- 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

A method, system and article of manufacture for accessing data in a database independent of the particular manner in which the data is physically represented and for preventing alterations of data in the database when a query is executed against the database are provided. One embodiment provides a method of preventing alterations of data in a database when a query is executed against the database. The method includes providing a logical representation of the data defining a plurality of logical fields abstractly describing associated physical entities of the data; receiving an abstract query comprising at least one logical field of the plurality of logical fields; and locking the at least one logical field before executing the abstract query.

## Claims

### Claim 1

A computer-implemented method of preventing alterations of data in a database when a query is executed against the database, comprising:
providing a logical representation of the data defining a plurality of logical fields abstractly describing a manner of accessing and exposing, via a user interface, associated physical entities of the data, wherein each of the plurality of logical fields include a reference to an access method selected from at least two different access method types; wherein the at least two different access method types are selected from the group comprising: (i) a simple access method which maps a respective one of the plurality of logical fields directly to a physical entity, (ii) a filtered access method which identifies a physical entity and provides rules used to define a subset of items within the physical entities, and (iii) a composed access method which computes a value for a respective one of the plurality of logical fields from one or more physical entities using an expression supplied as part of a composed access method definition; wherein each of the different access methods types defines a different manner of exposing the respective physical entities of the data; and wherein at least a portion of the plurality of logical fields include lock attributes referenced in order to lock the respective logical field;
receiving an abstract query comprising at least one logical field of the portion of logical fields;
in response to receiving the abstract query, locking, on the basis of the respective lock attributes, the at least one logical field before executing the abstract query; and
unlocking at least one logical field after executing the abstract query.

### Claim 2 (depends on 1)

The method of claim 1, wherein the lock attributes of the at least one logical field comprise a synchronization indication of whether a lock on the logical field is required or not, and wherein locking the at least one logical field comprises:
determining, from the synchronization indication, whether executing the abstract query against the database requires a lock on the at least one logical field; and
locking the at least one logical field, only if executing the abstract query requires the lock on the at least one logical field.

### Claim 3 (depends on 1)

The method of claim 1, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not and a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the at least one logical field comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the at least one logical field; and
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 4 (depends on 1)

The method of claim 1, wherein the lock attributes of the at least one logical field comprises a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the at least one logical field comprises:
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 5 (depends on 1)

The method of claim 1, wherein the database is one of a hierarchical, a relational and an XML type database.

### Claim 6

A computer-implemented method of preventing alterations of physical entities of data in a database when a query is executed against the database, comprising:
providing a logical representation of the data defining a multiplicity of logical fields, each logical field abstractly describing a manner of accessing and exposing, via a user interface, an associated physical entity of the data; wherein each of the multiplicity of logical fields include a reference to an access method selected from at least two different access method types; wherein the at least two different access method types are selected from the group comprising: (i) a simple access method which maps a respective one of the plurality of logical fields directly to a physical entity, (ii) a filtered access method which identifies a physical entity and provides rules used to define a subset of items within the physical entities, and (iii) a composed access method which computes a value for a respective one of the plurality of logical fields from one or more physical entities using an expression supplied as part of a composed access method definition;
wherein each of the different access methods types defines a different manner of exposing the respective physical entity of the data; and wherein at least a portion of the multiplicity of logical fields include lock attributes referenced in order to lock the respective logical field;
providing a lock object for each logical field of a plurality of logical fields forming a subset of the multiplicity of logical fields, the respective lock object being identified by the respective lock attributes of the respective logical field;
receiving an abstract query from a requesting entity comprising at least one logical field of the multiplicity of logical fields; and
upon determining that executing the abstract query against the database requires the lock on the at least one logical field;
determining the lock object of the at least one logical field;
locking the lock object for the requesting entity for locking the at least one logical field before executing the abstract query; and
unlocking the lock object for the requesting entity after executing the abstract query.

### Claim 7 (depends on 6)

The method of claim 6, wherein the requesting entity is one of a user and an application.

### Claim 8 (depends on 6)

The method of claim 6, further comprising:
running an update on a physical entity of the data in the database corresponding to the at least one logical field, comprising:
accessing the lock object; and
determining that the lock object is locked, delaying the update.

### Claim 9 (depends on 6)

The method of claim 6, wherein locking the lock object comprises setting a corresponding flag in an owner object associated with the requesting entity.

### Claim 10 (depends on 6)

The method of claim 6, wherein receiving an abstract query comprises receiving a plurality of abstract queries associated with a plurality of requesting entities, and wherein locking the at least one logical field comprises locking a corresponding lock object for each requesting entity of the plurality of requesting entities.

### Claim 11 (depends on 10)

The method of claim 10, wherein the requesting entity is one of a user and an application.

### Claim 12 (depends on 6)

The method of claim 6, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not, and wherein locking the lock object for the requesting entity comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the lock object.

### Claim 13 (depends on 6)

The method of claim 6, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not and a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the lock object for the requesting entity comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the lock object; and
upon determining, from the lock item indication, whether executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 14 (depends on 6)

The method of claim 6, wherein the lock attributes of the at least one logical field comprises a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the lock object for the requesting entity comprises:
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 15 (depends on 6)

The method of claim 6, wherein the database is one of a hierarchical, a relational and an XML type database.

### Claim 16

A tangible computer-readable storage medium containing a program which, when executed by a processor, performs an operation of preventing alterations of data in a database when a query is executed against the database, the operation comprising:
providing a logical representation of the data defining a plurality of logical fields abstractly describing a manner of accessing and exposing, via a user interface, associated physical entities of the data, wherein each of the plurality of logical fields include a reference to an access method selected from at least two different access method types; wherein the at least two different access method types are selected from the group comprising: (i) a simple access method which maps a respective one of the plurality of logical fields directly to a physical entity, (ii) a filtered access method which identifies a physical entity and provides rules used to define a subset of items within the physical entities, and (iii) a composed access method which computes a value for a respective one of the plurality of logical fields from one or more physical entities using an expression supplied as part of a composed access method definition; wherein each of the different access methods types defines a different manner of exposing the respective physical entities of the data; and wherein at least a portion of the plurality of logical fields include lock attributes referenced in order to lock the respective logical field;
receiving an abstract query comprising at least one logical field of the portion of logical fields;
in response to receiving the abstract query, locking the at least one logical field before executing the abstract query on the basis of the respective lock attributes of the at least one logical field; and
unlocking at least one logical field after executing the abstract query.

### Claim 17 (depends on 16)

The computer-readable storage medium of claim 16, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not, and wherein locking the at least one logical field comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the at least one logical field.

### Claim 18 (depends on 16)

The computer-readable storage medium of claim 16, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not and a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the at least one logical field comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the at least one logical field; and
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 19 (depends on 16)

The computer-readable storage medium of claim 16, wherein the lock attributes of the at least one logical field comprises a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the at least one logical field comprises:
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 20 (depends on 16)

The computer-readable storage medium of claim 16, wherein the abstract query comprises at least one selection criterion and a result specification.

### Claim 21 (depends on 16)

The computer-readable storage medium of claim 16, further comprising transforming the abstract query into a query consistent with the particular physical representation according to properties described in the at least one logical field.

### Claim 22 (depends on 21)

The computer-readable storage medium of claim 21, where the query consistent with the particular physical representation is one of an SQL query and an XML query.

### Claim 23 (depends on 16)

The computer-readable storage medium of claim 16, wherein each logical field comprises an access method for the associated physical entity of the data.

### Claim 24 (depends on 23)

The computer-readable storage medium of claim 23, wherein the access method describes a location of the associated physical entity in the database.

### Claim 25 (depends on 16)

The computer-readable storage medium of claim 16, wherein the database is one of a hierarchical, a relational and an XML type database.

### Claim 26

A tangible computer-readable storage medium containing a program which, when executed by a processor, performs an operation of preventing alterations of physical entities of data in a database when a query is executed against the database, the operation comprising:
providing a logical representation of the data defining a multiplicity of logical fields, each logical field abstractly describing a manner of accessing and exposing, via a user interface, an associated physical entity of the data; wherein each of the multiplicity of logical fields include a reference to an access method selected from at least two different access method types; wherein the at least two different access method types are selected from the group comprising: (i) a simple access method which maps a respective one of the plurality of logical fields directly to a physical entity, (ii) a filtered access method which identifies a physical entity and provides rules used to define a subset of items within the physical entities, and (iii) a composed access method which computes a value for a respective one of the plurality of logical fields from one or more physical entities using an expression supplied as part of a composed access method definition; wherein each of the different access methods types defines a different manner of exposing the respective physical entity of the data; and wherein at least a portion of the multiplicity of logical fields include lock attributes referenced in order to lock the respective logical field;
providing a lock object for each logical field of a plurality of logical fields forming a subset of the multiplicity of logical fields, the respective lock object being identified by the respective lock attributes of the respective logical field;
receiving an abstract query from a requesting entity comprising at least one logical field of the multiplicity of logical fields; and
upon determining that executing the abstract query against the database requires the lock on the at least one logical field:
determining the lock object of the at least one logical field;
locking the lock object for the requesting entity for locking the at least one logical field before executing the abstract query; and
unlocking the lock object after executing the abstract query.

### Claim 27 (depends on 26)

The computer-readable storage medium of claim 26, wherein the requesting entity is one of a user and an application.

### Claim 28 (depends on 26)

The computer-readable storage medium of claim 26, wherein the operation further comprises:
running an update on a physical entity of the data in the database corresponding to the at least one logical field, comprising:
accessing the lock object; and
upon determining that the lock object is locked, delaying the update.

### Claim 29 (depends on 26)

The computer-readable storage medium of claim 26, wherein locking the lock object comprises setting a corresponding flag in an owner object associated with the requesting entity.

### Claim 30 (depends on 26)

The computer-readable storage medium of claim 26, wherein receiving an abstract query comprises receiving a plurality of abstract queries associated with a plurality of requesting entities, and wherein locking the at least one logical field comprises locking a corresponding lock object for each requesting entity of the plurality of requesting entities.

### Claim 31 (depends on 30)

The computer-readable storage medium of claim 30, wherein the requesting entity is one of a user and an application.

### Claim 32 (depends on 26)

The computer-readable storage medium of claim 26, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not, and wherein locking the lock object for the requesting entity comprises:
determining, from the synchronization indication, whether executing the abstract query against the database requires a lock on the at least one logical field; and
only if executing the abstract query requires the lock on the at least one logical field, locking the lock object.

### Claim 33 (depends on 26)

The computer-readable storage medium of claim 26, wherein the lock attributes of the at least one logical field comprises a synchronization indication of whether a lock on the logical field is required or not and a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the lock object for the requesting entity comprises:
upon determining, from the synchronization indication, that executing the abstract query against the database requires a lock on the at least one logical field, locking the at least one logical field; and
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 34 (depends on 26)

The computer-readable storage medium of claim 26, wherein the lock attributes of the at least one logical field comprises a lock item indication of whether a lock on a corresponding physical entity of the data is required or not, and wherein locking the lock object for the requesting entity comprises:
upon determining, from the lock item indication, that executing the abstract query against the database requires a lock on the corresponding physical entity of the data, locking the corresponding physical entity before executing the abstract query.

### Claim 35 (depends on 26)

The computer-readable storage medium of claim 26, wherein the database is one of a hierarchical, a relational and an XML type database.

### Claim 36

A computer, comprising:
a processor;
a database containing data;
a data abstraction model defining a plurality of logical fields abstractly defining a manner of accessing and exposing, via a user interface, the data; wherein each of the plurality of logical fields include a reference to an access method selected from at least two different access method types; wherein the at least two different access method types are selected from the group comprising: (i) a simple access method which maps a respective one of the plurality of logical fields directly to a physical entity, (ii) a filtered access method which identifies a physical entity and provides rules used to define a subset of items within the physical entities, and (iii) a composed access method which computes a value for a respective one of the plurality of logical fields from one or more physical entities using an expression supplied as part of a composed access method definition; wherein each of the different access methods types defines a different manner of exposing respective physical entities of the data; and wherein at least a portion of the plurality of logical fields include lock attributes referenced in order to lock the respective logical field;
a query building application for building abstract queries according to the data abstraction model;
a runtime component configured to transform the abstract queries into concrete queries having a form consistent with the data; and
a locking mechanism for selectively locking, on the basis of their respective lock attributes, one or more logical fields of an abstract query, prior to execution of a concrete query in which the abstract query has been transformed by the runtime component, to prevent alterations of the data while a concrete query, corresponding to the abstract query after being transformed, is executed against the database, and for unlocking the one or more logical fields after execution of the concrete query.
