asn统计updatesql,不分批次提交
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user