IP Library Granted Patent US 10,970,262
Granted Patent B2
US 10,970,262 · App. 16/200,652 · Granted Apr 6, 2021

Multiple versions of triggers in a database system

Inventors: Tammie Dang (Morgan Hill, CA); Illong A. Huang (San Jose, CA); David J. Kuang (Elk Grove, CA); Fen-Ling Lin (San Jose, CA); Claire W. McFeely (San Jose, CA); Maryela E. Weihrauch (San Jose, CA); Binghui Zhong (San Jose, CA)
Assignee: International Business Machines Corporation
G06F16/219G06F16/21G06F16/24565
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 10,970,262
App. No.
16/200,652
Granted
Apr 6, 2021
Kind
B2
Abstract

In managing multiple versions of triggers, a database system creates a first version of a trigger to apply a first set of actions in response to a first triggering event. The database system also creates a second version of the trigger to apply a second set of actions to the database object in response to a second triggering event. Upon receiving a command to set the current version of the trigger to the second version, the database system sets the second version as the current version of the trigger. When the triggering event of the trigger occurs, the database system determines that the second version is the current version of the trigger, retrieves the second set of actions in the second version, and executes the second set of actions.

Claims (99)

1. A method for managing multiple versions of triggers in a database system, comprising:

receiving a first command to create a first version of a trigger to apply a first set of actions in response to a triggering event, the triggering event comprising an input/output operation on a database object;

based on the first command, creating the first version of the trigger to apply the first set of actions in response to the triggering event, comprising:

creating the first version of the trigger to comprise the first set of actions;

linking the first version of the trigger to the database object; and

setting the first version as a current version of the trigger;

receiving a second command to create a second version of the trigger to apply a second set of actions in response to the triggering event;

based on the second command, creating the second version of the trigger to apply the second set of actions in response to the triggering event, without deleting the first version of the trigger, comprising:

creating the second version of the trigger to comprise the second set of actions; and

linking the second version to the database object;

receiving a third command to set the current version of the trigger to the second version;

in response to receiving the third command, setting the second version as the current version of the trigger;

determining that the triggering event of the trigger occurs;

in response to determining that the triggering event occurs, determining that the second version is the current version of the trigger;

in response to determining that the second version is the current version of the trigger, retrieving the second set of actions comprised in the second version; and

executing the second set of actions.

2. The method of claim 1 , wherein the creating of the first version of the trigger comprises:

creating the first version to contain a first set of statements for the first version of the trigger;

creating a first trigger object descriptor for the first version;

assigning a first unique identifier to the first trigger object descriptor;

linking the first trigger object descriptor for the database object; and

associating the first unique identifier with the trigger in a current version map.

3. The method of claim 2 , wherein the creating of the second version of the trigger comprises:

creating the second version to contain a second set of statements for the second version of the trigger;

creating a second trigger object descriptor for the second version;

assigning a second unique identifier to the second trigger object descriptor; and

linking the second trigger object descriptor to database object descriptor.

4. The method of claim 1 , further comprising:

creating a replacement version to replace a given version of the trigger to apply a replacement set of actions in response to the triggering event, comprising:

creating the replacement version of the trigger to comprise the replacement set of actions; and

replacing a link between the given version and the database object with a link between the replacement version and the database object.

5. The method of claim 1 , further comprising:

wherein further based on the first command, associating the first version with the trigger in a current version map,

wherein further based on the third command, removing the association of the first version with the trigger from the current version map and associating the second version with the trigger in the current version map,

wherein the determining that the second version is the current version of the trigger comprises determining that the second version is associated with the trigger in the current version map.

6. A computer program product for managing multiple versions of triggers in a database system, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to:

receive a first command to create a first version of a trigger to apply a first set of actions in response to a triggering event, the triggering event comprising an input/output operation on a database object;

based on the first command, create the first version of the trigger to apply the first set of actions in response to the triggering event, comprising:

create the first version of the trigger to comprise the first set of actions;

link the first version to the database object; and

set the first version as a current version of the trigger;

receive a second command to create a second version of the trigger to apply a second set of actions in response to the triggering event;

based on the second command, create the second version of the trigger to apply the second set of actions in response to the second triggering event, without deleting the first version of the trigger, comprising:

create the second version of the trigger to comprise the second set of actions; and

link the second version to the database object;

receive a third command to set the current version of the trigger to the second version;

in response to receiving the third command, set the second version as the current version of the trigger;

determine that the triggering event of the trigger occurs;

in response to determining that the triggering event occurs, determine that the second version is the current version of the trigger;

in response to determining that the second version is the current version of the trigger, retrieve the second set of actions comprised in the second version; and

execute the second set of actions.

7. The computer program product of claim 6 , wherein the creating of the first version of the trigger comprises:

create the first version to contain a first set of statements for the first version of the trigger;

create a first trigger object descriptor for the first version;

assign a first unique identifier to the first trigger object descriptor;

link the first trigger object descriptor for the database object; and

associate the first unique identifier with the trigger in a current version map.

8. The computer program product of claim 7 , wherein the creating of the second version of the trigger comprises:

create the second version to contain a second set of statements for the second version of the trigger;

create a second trigger object descriptor for the second version;

assign a second unique identifier to the second trigger object descriptor; and

link the second trigger object descriptor to database object descriptor.

9. The computer program product of claim 6 , further comprising:

wherein further based on the first command, associate the first version with the trigger in a current version map,

wherein further based on the third command, remove the association of the first version with the trigger from the current version map and associate the second version with the trigger in the current version map,

wherein the determining that the second version is the current version of the trigger comprises: determine that the second version is associated with the trigger in the current version map.

10. A system, comprising:

a processor; and

a computer readable storage medium having program instructions embodied therewith, the program instructions executable by the processor to cause the processor to:

receive a first command to create a first version of a trigger to apply a first set of actions in response to a triggering event, the triggering event comprising an input/output operation on a database object;

based on the first command, create the first version of the trigger to apply the first set of actions in response to the triggering event, comprising:

create the first version of the trigger to comprise the first set of actions;

link the first version to the database object; and

set the first version as a current version of the trigger;

receive a second command to create a second version of the trigger to apply a second set of actions in response to the triggering event;

based on the second command, create the second version of the trigger to apply the second set of actions in response to the triggering event, without deleting the first version of the trigger, comprising:

create the second version of the trigger to comprise the second set of actions; and

link the second version to the database object;

receive a third command to set the current version of the trigger to the second version;

in response to receiving the third command, set the second version as the current version of the trigger;

determine that the triggering event of the trigger occurs;

in response to determining that the triggering event occurs, determine that the second version is the current version of the trigger;

in response to determining that the second version is the current version of the trigger, retrieve the second set of actions comprised in the second version; and

execute the second set of actions.

11. The system of claim 10 , wherein the creating of the first version of the trigger comprises:

create the first version to contain a first set of statements for the first version of the trigger;

create a first trigger object descriptor for the first version;

assign a first unique identifier to the first trigger object descriptor;

link the first trigger object descriptor for the database object; and

associate the first unique identifier with the trigger in a current version map.

12. The system of claim 11 , wherein the creating of the second version of the trigger comprises:

create the second version to contain a second set of statements for the second version of the trigger;

create a second trigger object descriptor for the second version;

assign a second unique identifier to the second trigger object descriptor; and

link the second trigger object descriptor to database object descriptor.

13. The system of claim 10 , further comprising:

wherein further based on the first command, associate the first version with the trigger in a current version map,

wherein further based on the third command, remove the association of the first version with the trigger from the current version map and associate the second version with the trigger in the current version map,

wherein the determining that the second version is the current version of the trigger comprises: determine that the second version is associated with the trigger in the current version map.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 27, 2018
From: DANG, TAMMIE; HUANG, ILLONG A.; KUANG, DAVID J.; LIN, FEN-LING; MCFEELY, CLAIRE W.; WEIHRAUCH, MARYELA E.; ZHONG, BINGHUI
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 047637/0425 →
Continuity (2)
Continuation 15192343 · Jun 24, 2016
Related Publication 20190095386A1 · Mar 28, 2019