Subject | concurrent inserts issue |
---|---|
Author | firebirdsql |
Post date | 2012-07-11T00:51:53Z |
When I run the below query as a stored procedure asynchronously 1000 times, it results in duplicate numbers:
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.
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.