并发处理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
public class moniBingFa{ @future public static void bingfafuc(){ try{ for(Integer i=1; i <5; i++){ Order__c o = new Order__c(); o.Name = 'xxxxx'; insert o; } }catch(Exception e){ Interface_Log__c inlog = new Interface_Log__c(); inlog.SycnStatus__c = 'Fail'; inlog.API_Method__c = '订单编码重复测试'; inlog.API_Params__c = e.getMessage(); inlog.IntegrationUser__c = UserInfo.getUserId(); insert inlog; } } } |
调用方法
1 2 3 4 5 6 7 8 9 10 11 12 |
moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); moniBingFa.bingfafuc(); |