IP Library Granted Patent US 10,216,774
Granted Patent B2
US 10,216,774 · App. 15/192,343 · Granted Feb 26, 2019

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
G06F17/30309G06F17/3051G06F17/30289
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,216,774
App. No.
15/192,343
Granted
Feb 26, 2019
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, which includes: creating a first package for the first version of the trigger to include the first set of actions; linking the first package to the database object; and setting the first package as a current version of the trigger. The database system 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, which includes: creating a second package for the second version of the trigger to include the second set of actions; and linking the second package to the database object. In response to a command, the database system sets the current version of the trigger to the second package.

Claims (100)

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 a delete, insert or update 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 a first package for the first version of the trigger, the first package comprising the first set of actions;

linking the first package to the database object; and

setting the first package 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 a second package for the second version of the trigger, the second package comprising the second set of actions; and

linking the second package 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 package 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 package; 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 package to contain a first set of statements for the first version of the trigger;

creating a first trigger object descriptor for the first package;

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 package to contain a second set of statements for the second version of the trigger;

creating a second trigger object descriptor for the second package;

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 3 , wherein in response to receiving the third command, removing the association of the first trigger object descriptor with the trigger from the current version map and associating the second unique identifier with the trigger in the current version map.

5. 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 a replacement package for the replacement version of the trigger, the replacement package comprising the replacement set of actions; and

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

6. The method of claim 1 , further comprising:

receiving a fourth command to delete a given version of the trigger; and

in response to receiving the fourth command, removing a link between the given version and the database object.

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

8. 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 a delete, insert or update 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 a first package for the first version of the trigger, the first package comprising the first set of actions;

link the first package to the database object; and

set the first package 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 a second package for the second version of the trigger, the second package comprising the second set of actions; and

link the second package 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 package; and

execute the second set of actions.

9. The computer program product of claim 8 , wherein the creating of the first version of the trigger comprises: create the first package to contain a first set of statements for the first version of the trigger; create a first trigger object descriptor for the first package; assign a first unique identifier to the first trigger object descriptor the first trigger object descriptor for the database object; and associate the first unique identifier with the trigger in a current version map.

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

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

create a second trigger object descriptor for the second package;

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

link the second trigger object descriptor to database object descriptor.

11. The computer program product of claim 10 , wherein in response to receiving the third command, remove the association of the first trigger object descriptor with the trigger from the current version map and associate the second unique identifier with the trigger in a current version map.

12. The computer program product of claim 8 , 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.

13. 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 a delete, insert or update 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 a first package for the first version of the trigger, the first package comprising the first set of actions;

link the first package to the database object; and

set the first package 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 a second package for the second version of the trigger, the second package comprising the second set of actions; and

link the second package 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 package; and

execute the second set of actions.

14. The system of claim 13 , wherein the creating of the first version of the trigger comprises:

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

create a first trigger object descriptor for the first package;

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.

15. The system of claim 14 , wherein the creating of the second version of the trigger comprises:

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

create a second trigger object descriptor for the second package;

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

link the second trigger object descriptor to database object descriptor.

16. The system of claim 15 , wherein in response to receiving the third command, remove the association of the first trigger object descriptor with the trigger from the current version map and associate the second unique identifier with the trigger in the current version map.

17. The system of claim 13 , 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 Jun 24, 2016
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 039156/0008 →
Continuity (1)
Related Publication 20170371905A1 · Dec 28, 2017
Cited By (13)
US 12,204,536 US 12,204,593 US 12,248,484 US 12,265,525 US 12,271,389 US 12,287,790 US 12,393,631 US 12,436,963 US 12,585,638 US 12,613,864 US 12,639,379 US 12,650,965 US 12,670,152