开发四年只会写业务代码,分布式高并发都不会还做程序员?->>>
当数据库并发时。我只能允许插入一条记录,如何防止插入多条。。。
insert into tmp_dim
select 1,'A' from dual where not exists (select 1 from tmp_dim where id=1);
如果开启事务的时候,两条数据执行到这个语句时都没有获得提交,就会插入两条。。
...全文
354打赏收藏
怎么防止oracle幻读,脏读
开发四年只会写业务代码,分布式高并发都不会还做程序员?->>> 当数据库并发时。我只能允许插入一条记录,如何防止插入多条。。。 insert into tmp_dim select 1,'A' from dual where not exists (select 1 from tmp_dim where id=1); 如果开启事务的时候,两条数据执行到这个语句时都没有获得提交,就会插入两条。。