Subject | Re: [IB-Architect] Trigger Classes |
---|---|
Author | Martijn Tonies |
Post date | 2001-10-23T19:09:52Z |
Hi Jim,
coming to this, is there an easy way to implement deactivation of
constraints? I believe (haven't looked into the source of FB) that (almost)
all constraints are enforced by triggers, right?
--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
"Jim Starkey" <jas@...> wrote in message
news:3.0.5.32.20011015165349.00b6ee70@......
coming to this, is there an easy way to implement deactivation of
constraints? I believe (haven't looked into the source of FB) that (almost)
all constraints are enforced by triggers, right?
--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
"Jim Starkey" <jas@...> wrote in message
news:3.0.5.32.20011015165349.00b6ee70@......
> While I'm in the area, I thought I'd share a solution to the
> problem of programatic activation/deactivation of triggers.
>
> Netfrastructure has a trigger happy customer who desired
> to deactivate selected triggers during certain system management
> operations but without taking the database generally off line.
> The Interbase DDL to set triggers inactive was too crude a
> tool since that would affect all users, not just his system
> administration procedures. I came up with a simple, elegant
> (well, I think so), lightweight solution that seems to answer
> nicely.
>
> The mechanism consists of another clause on trigger definitions
> ( class <trigger_class_name> ) and two two DDL systems
> "enable <trigger_class_name>" and "disable <trigger_class_name>".
> Yes, a trigger may be a member of an arbitrary number of classes.
>
> The disable statement disables triggers of the given name for
> either the duration of connection or until the trigger class
> is explicitly enabled with the enable trigger class statement.
>
> Trigger classes are not explicitly declared, just used.
>
> The implementation is dirt cheap. The attachment object keeps
> a list of disabled class names. Before a prospective trigger
> fires, it loops through the set of disabled classes to see
> if it has been turned off.
>
> Jim Starkey
>
> To unsubscribe from this group, send an email to:
> IB-Architect-unsubscribe@onelist.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>