Subject Re: [Firebird-Architect] Execute procedure using Role ?
Author Alexander peshkoff
On Monday 25 May 2009 17:25:30 Vlad Khorsun wrote:
> >> Your problem can be solved much easier.
> >>
> >> create table specFlags(x int);
> >> grant all on specFlags to <list of your procedures>;
> >> grant select on specFlags to public;
> >>
> >> In procedure:
> >>
> >> insert into specFlags values(current_transaction);
> >> <do-what-you-need>;
> >> delete from specFlags where x = current_transaction;
> >>
> >> In trigger:
> >> if (exists (select * from specFlags where x =
> >> current_transaction)) then ....
> >
> > I had looked at something like this before, but it gets messy
> > for some of the same reasons you describe above. It is a large
> > modular system in which procedures call procedures so we end
> > up needing the table of flags to deal with things in a stack
> > or reference counter arrangement. When you consider the flag
> > table maintenance has to go around BEGIN ... WHEN ANY ... END
> > blocks - it gets quite horrible to maintain and starts to make
> > even the most simple procedures quite ugly.
>
> Probably GTT ON COMMIT DELETE ROWS would be helpful there

Security problem - on error thrown client has transaction with filled GTT.