Karl wrote:
Can a View be used to avoid deadlocks?
I have a trigger that needs to select data from a row of a table that
may have been locked (possibly by the same execution thread that caused
the trigger to fire). I can't set the Isolation level of the Trigger
nor the SQL statement within the trigger(I believe that this is not
allowed).
Views are simply macros, so the short answer is no.
Howvere your reasoning is flawed. A session cannot lock withitself
unless you have started a new connection (unsupported) through a
backdoor external procedure.
If you really want to use a lower isolation level within teh trigger you
can experiment with a CALL statement in the trigger.
You can then either create the procedure with the appropriate bind
option or use the isolation clause on individual statements.
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab