有个存储过程,插入前先判断有无记录select count(1) into v_count from table where name='10',然后再insert table(name) values('10'),update table2 set ......,但是在多线程情况下会插入重复的记录,除了约束还有什么办法?因为约束会转到异常,而我需要继续update table2
...全文
5161打赏收藏
oracle多线程并发插入避免重复。
有个存储过程,插入前先判断有无记录select count(1) into v_count from table where name='10',然后再insert table(name) values('10'),update table2 set ......,但是在多线程情况下会插入重复的记录,除了约束还有什么办法?因为约束会转到异常,而我需要继续update table2