From a7914aafac04b149a31f5788aae8df5853d793f0 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Sun, 27 Jan 2019 18:07:43 +0600 Subject: [PATCH] =?UTF-8?q?asn=E7=BB=9F=E8=AE=A1updatesql=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=88=86=E6=89=B9=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/web/task/StatisticASNIpNumer.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/nis/web/task/StatisticASNIpNumer.java b/src/main/java/com/nis/web/task/StatisticASNIpNumer.java index d9a7ae111..7b5a534d7 100644 --- a/src/main/java/com/nis/web/task/StatisticASNIpNumer.java +++ b/src/main/java/com/nis/web/task/StatisticASNIpNumer.java @@ -111,15 +111,11 @@ public class StatisticASNIpNumer { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try { + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, true); for(Entry> e: asnNumerMap.entrySet()) { - batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); ((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).updateIpNum(e.getValue().get("v4"),e.getValue().get("v6"),e.getKey()); - if(index!= 0 && index%20000==0){ - batchSqlSession.commit(); - } index++; } - batchSqlSession.commit(); }catch (Exception e) { logger.error("修改ASN IP个数失败", e); } finally {