From 541547e5b989d4f6a6e9544e3bc46e18fd89aece Mon Sep 17 00:00:00 2001 From: dailidong Date: Tue, 7 May 2019 17:03:37 +0800 Subject: [PATCH 1/2] /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.escheduler.common.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.*; public class MysqlUtils { public static final Logger logger = LoggerFactory.getLogger(MysqlUtils.class); private static MysqlUtils instance; MysqlUtils() { } public static MysqlUtils getInstance() { if (null == instance) { syncInit(); } return instance; } private static synchronized void syncInit() { if (instance == null) { instance = new MysqlUtils(); } } public void release(ResultSet rs, Statement stmt, Connection conn) { try { if (rs != null) { rs.close(); rs = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } finally { try { if (stmt != null) { stmt.close(); stmt = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } finally { try { if (conn != null) { conn.close(); conn = null; } } catch (SQLException e) { logger.error(e.getMessage(),e); throw new RuntimeException(e); } } } } public static void releaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { MysqlUtils.getInstance().release(rs,ps,conn); if (null != rs) { try { rs.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } if (null != ps) { try { ps.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } if (null != conn) { try { conn.close(); } catch (SQLException e) { logger.error(e.getMessage(),e); } } } } --- .../escheduler/common/utils/{MysqlUtil.java => MysqlUtils.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename escheduler-common/src/main/java/cn/escheduler/common/utils/{MysqlUtil.java => MysqlUtils.java} (100%) diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtil.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java similarity index 100% rename from escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtil.java rename to escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java From 5a8c8ef9436f7dbcc9535575c094dda9db4080f6 Mon Sep 17 00:00:00 2001 From: dailidong Date: Fri, 10 May 2019 11:05:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.0.2=E6=96=87=E6=A1=A3=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 12 +++++------ .../escheduler/common/utils/MysqlUtils.java | 16 +++++++------- .../cn/escheduler/dao/upgrade/UpgradeDao.java | 18 ++++++++-------- pom.xml | 21 +++++++++---------- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/escheduler-api/src/main/resources/application.properties b/escheduler-api/src/main/resources/application.properties index bf003bfdda..2709f419ef 100644 --- a/escheduler-api/src/main/resources/application.properties +++ b/escheduler-api/src/main/resources/application.properties @@ -2,15 +2,13 @@ server.port=12345 # session config -server.session.timeout=7200 +server.servlet.session.timeout=7200 - -server.context-path=/escheduler/ +server.servlet.context-path=/escheduler/ # file size limit for upload -spring.http.multipart.max-file-size=1024MB -spring.http.multipart.max-request-size=1024MB +spring.servlet.multipart.max-file-size=1024MB +spring.servlet.multipart.max-request-size=1024MB #post content -server.max-http-post-size=5000000 - +server.jetty.max-http-post-size=5000000 diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java index d2d1ef203d..3520527c1a 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/utils/MysqlUtils.java @@ -21,16 +21,16 @@ import org.slf4j.LoggerFactory; import java.sql.*; -public class MysqlUtil { +public class MysqlUtils { - public static final Logger logger = LoggerFactory.getLogger(MysqlUtil.class); + public static final Logger logger = LoggerFactory.getLogger(MysqlUtils.class); - private static MysqlUtil instance; + private static MysqlUtils instance; - MysqlUtil() { + MysqlUtils() { } - public static MysqlUtil getInstance() { + public static MysqlUtils getInstance() { if (null == instance) { syncInit(); } @@ -39,7 +39,7 @@ public class MysqlUtil { private static synchronized void syncInit() { if (instance == null) { - instance = new MysqlUtil(); + instance = new MysqlUtils(); } } @@ -75,8 +75,8 @@ public class MysqlUtil { } } - public static void realeaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { - MysqlUtil.getInstance().release(rs,ps,conn); + public static void releaseResource(ResultSet rs, PreparedStatement ps, Connection conn) { + MysqlUtils.getInstance().release(rs,ps,conn); if (null != rs) { try { rs.close(); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java b/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java index 96199b0725..6fc8a61417 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/upgrade/UpgradeDao.java @@ -16,7 +16,7 @@ */ package cn.escheduler.dao.upgrade; -import cn.escheduler.common.utils.MysqlUtil; +import cn.escheduler.common.utils.MysqlUtils; import cn.escheduler.common.utils.ScriptRunner; import cn.escheduler.dao.AbstractBaseDao; import cn.escheduler.dao.datasource.ConnectionFactory; @@ -98,7 +98,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -126,7 +126,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -152,7 +152,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -179,7 +179,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, null, conn); + MysqlUtils.releaseResource(null, null, conn); } @@ -207,7 +207,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException("sql: " + sql, e); } finally { - MysqlUtil.realeaseResource(rs, pstmt, conn); + MysqlUtils.releaseResource(rs, pstmt, conn); } } @@ -277,7 +277,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } @@ -316,7 +316,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException(e.getMessage(),e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } @@ -338,7 +338,7 @@ public class UpgradeDao extends AbstractBaseDao { logger.error(e.getMessage(),e); throw new RuntimeException("sql: " + upgradeSQL, e); } finally { - MysqlUtil.realeaseResource(null, pstmt, conn); + MysqlUtils.releaseResource(null, pstmt, conn); } } diff --git a/pom.xml b/pom.xml index 3847b49fd3..4e9cc32dca 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,7 @@ 1.2.3 2.7.3 2.2.3 + 2.9.8 @@ -163,27 +164,27 @@ org.apache.httpcomponents httpclient - 4.3.2 + 4.4.1 org.apache.httpcomponents httpcore - 4.3.2 + 4.4.1 com.fasterxml.jackson.core jackson-annotations - 2.8.6 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.8.6 + ${jackson.version} com.fasterxml.jackson.core jackson-core - 2.8.6 + ${jackson.version} @@ -241,8 +242,6 @@ 1.10 - - ch.qos.logback logback-classic @@ -368,13 +367,13 @@ - + scm:git:https://github.com/analysys/EasyScheduler.git scm:git:https://github.com/analysys/EasyScheduler.git https://github.com/analysys/EasyScheduler.git - HEAD - + HEAD + @@ -435,7 +434,7 @@ - +