10线程同时操作,频繁出现插入同样数据的问题。虽然在插入数据的时候使用了: insert inti tablename(fields….) select t1,t2,t3 from tablename where not exists (select id from tablename where t1=t1,t2=t2,t3=t3) 当时还是在高并发的情况下无效。此语句也包含在存储过程中。(之前也尝试线判断有无记录再看是否写入,无效)。 因此,对于此类情况还是需要从数据库的根本来解决,就是约束