Subject | Re: [firebird-support] concurrent inserts issue |
---|---|
Author | Helen Borrie |
Post date | 2012-07-11T01:57:54Z |
At 12:51 PM 11/07/2012, firebirdsql wrote:
./hb
>When I run the below query as a stored procedure asynchronously 1000 times, it results in duplicate numbers:You solve it by not doing it. Use a generator to set this value.
>select count(id) from test_table into :number;
>insert into test_table(number) VALUES(:number+1);
>
>How do I solve this? I tried the WITH LOCK option but it doesn't work inside a stored procedure.
./hb