Commit e5ac6ec5 by huluobin

亚马逊广告

parent 67d8e7e6
......@@ -42,7 +42,9 @@ public class AmazonAdDownloadReportJob implements SimpleJob {
@Override
public void execute(ShardingContext shardingContext) {
try (SqlSession sqlSession = SessionUtil.getFactory().openSession(true)) {
SqlSession sqlSession = SessionUtil.getFactory().openSession(true);
try {
JobAmazonAdLogMapper jobAmazonAdLogMapper = sqlSession.getMapper(JobAmazonAdLogMapper.class);
DcBaseCompanyAccountMapper dcBaseCompanyAccountMapper = sqlSession.getMapper(DcBaseCompanyAccountMapper.class);
......@@ -125,6 +127,8 @@ public class AmazonAdDownloadReportJob implements SimpleJob {
}
});
} finally {
sqlSession.close();
}
}
......
......@@ -66,7 +66,7 @@ public class SessionUtil {
threadLocalTransction.set(null);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYSQL关闭Session异常",e);
throw new RuntimeException("MYSQL关闭Session异常", e);
}
}
......@@ -80,7 +80,7 @@ public class SessionUtil {
threadLocal.set(null);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYSQL关闭Session异常",e);
throw new RuntimeException("MYSQL关闭Session异常", e);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment