asn统计updatesql,不分批次提交

This commit is contained in:
duandongmei
2019-01-27 18:07:43 +06:00
parent 10e0064556
commit a7914aafac

View File

@@ -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<Integer,Map<String,Long>> 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 {