Subject | Re: How to 'lock' a table? |
---|---|
Author | Adam |
Post date | 2006-11-29T00:50:58Z |
--- In firebird-support@yahoogroups.com, "Fabiano Bonin"
<fabianobonin@...> wrote:
be allowed to run your protected code.
<fabianobonin@...> wrote:
>No
> That's a good idea. Do you think the code below is safe?
>Two transactions could get to this point at the same time. Both would
> set term !! ;
>
> create or alter procedure sp_test
> as
> declare variable v integer;
> begin
> while (gen_id(mygen, 0) <> 0) do
> begin
> end
be allowed to run your protected code.
> v = gen_id(mygen, 1);Adam
>
> -- my stuff here
>
> v = gen_id(mygen, -1);
> end !!
>
> set term ; !!