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 {