Subject | Re: [firebird-support] Instead-Of-Tigger on view causes infinite loop (probably in the engine!) |
---|---|
Author | Andrea Sansottera |
Post date | 2005-03-08T21:06:33Z |
Ann W. Harrison wrote:
server.
It happens while executing:
UPDATE "IngredientView" set "Acq" = 100 where ("Code" = 'ing01' or
"Code" = 'ing02')
(when both ingredient exists) (the same with more than two ingredients)
But does not happen while executing:
UPDATE "IngredientView" set "Acq" = 100 where "Code" = 'ing01'
Andrea
--
Andrea Sansottera
UGIdotNET [Italian] http://www.ugidotnet.org
My weblog [Italian] http://blogs.ugidotnet.org/andrew/
>Andrea,Thanks Ann, I'll try your code later.
>
>What I would do is start by breaking the trigger into several pieces.
>What I've done below is create a procedure that generates version
>numbers, an insert trigger that checks the validity of the operation and
>one, an update trigger that checks validity, an insert/update trigger
>that performs the operation, and a delete trigger.
>
>
>The procedure includes the insert into ElementVersion and the insertThe problem happens even when a single user is connected to the database
>into or update of Element. As a general rule, a trigger on an operation
>that causes an update of another table is an invitation for deadlocks -
>which may be what you're seeing if your problem happens when several
>users are trying to change the view.
>
>
server.
It happens while executing:
UPDATE "IngredientView" set "Acq" = 100 where ("Code" = 'ing01' or
"Code" = 'ing02')
(when both ingredient exists) (the same with more than two ingredients)
But does not happen while executing:
UPDATE "IngredientView" set "Acq" = 100 where "Code" = 'ing01'
>When you say "infinite loop", is the server using CPU time, or is itI t uses 100% of CPU time.
>just not returning?
>
>
Andrea
--
Andrea Sansottera
UGIdotNET [Italian] http://www.ugidotnet.org
My weblog [Italian] http://blogs.ugidotnet.org/andrew/