Subject Re: [firebird-support] How to 'lock' a table?
Author Alexandre Benson Smith
Hi Fabiano,

I would change it to
>
> set term !! ;
>
> create or alter procedure sp_test
> as
> declare variable v integer;
> begin
> if (gen_id(mygen, 0) <> 0) then
>
exit;
> v = gen_id(mygen, 1);
>
> -- my stuff here
>
> v = gen_id(mygen, -1);
> end !!
>
> set term ; !!
>

I would avoid a tight empty loop, I think it will cause FB to use 100% CPU

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br