wangwei 5 ani în urmă
părinte
comite
e116477ad9

+ 0 - 12
src/main/java/cn/com/qmth/examcloud/commons/util/DBUtil.java

@@ -136,18 +136,6 @@ public class DBUtil {
 			throw new RuntimeException(e);
 		}
 
-		final DataSource finalDataSource = dataSource;
-		Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
-			public void run() {
-				try {
-					DataSources.destroy(finalDataSource);
-				} catch (SQLException e) {
-					LOG.error("[JDBC] Fail to destroy dataSource. dataSourceName=" + dataSourceName,
-							e);
-				}
-			}
-		}));
-
 		Connection conn = null;
 		try {
 			conn = dataSource.getConnection();