Controlling database trigger execution with trigger return data
AssigneeInternational Business Machines Corporation
InventorMark J. Anderson
Life of this patent
Estimating the term…
Abstract
A database trigger generates a return code having the effect of inhibiting further executions of the trigger within a pre-defined scope of execution. Preferably, the pre-defined scope is a task or process executing on behalf of a particular user. Upon first encountering the applicable trigger condition, the corresponding trigger is fired normally. Internal logic within the trigger determines whether it is necessary to call the same trigger again within the same scope, and if not, generates corresponding return data. A database management system which manages the trigger and causes it to automatically fire intercepts the return data and disables further firing of the trigger for the pre-defined scope.
Claims20
A method for executing a database application having at least one database trigger, comprising the computer-executed steps of:
- executing at least one function of a database application to cause a database trigger to fire;
- responsive to firing said database trigger, executing internal logic within said database trigger to determine whether said database trigger should be disabled from further firing within a pre-defined scope;
- receiving return data generated by execution of said database trigger, said return data including results of determining whether said database trigger should be disabled from further firing within said pre-defined scope;
- and
- selectively disabling further firing of said database trigger within said pre-defined scope depending on the value of said return data.
A computer program product for managing database functions, comprising:
- a plurality of computer-executable instructions recorded on non-transitory computer readable media, wherein said instructions, when executed by at least one computer system, cause the at least one computer system to:
- detect during execution of a database function that a previously defined condition for firing a database trigger has been met;
- responsive to detecting during execution of a database function that a previously defined condition for firing a database trigger has been met, cause said database trigger to fire;
- receive return data generated by execution of said database trigger, said return data including results of determining whether said database trigger should be disabled from further firing within a pre-defined scope generated by executing internal logic within said database trigger responsive to firing said database trigger;
- and
- selectively disable further firing of said database trigger within said pre-defined scope depending on the value of said return data.
A computer system, comprising:
- a memory;
- at least one processor, said at least one processor executing instructions storable in said memory;
- a structured database containing data storable in said memory;
- a database trigger manager embodied as instructions executable on said at least one processor for managing the firing of one or more database triggers for said structured database, each database trigger of said one or more database triggers having a respective at least one pre-defined firing condition;
- wherein said database trigger manager, responsive to detecting the occurrence of a pre-defined firing condition of a database trigger of said one or more database triggers, causes the corresponding database trigger to fire, and receives return data generated by execution of the corresponding database trigger, said return data including results of determining whether said database trigger should be disabled from further firing within a pre-defined scope generated by executing internal logic within said database trigger responsive to firing said database trigger;
- and
- wherein said database trigger manager selectively disables further firing of the corresponding database trigger within a pre-defined scope depending on the value of said return data.
Dependencies are inferred from the claim text.