Explorar o código

Merge branch 'master' into dev

Caratacus %!s(int64=8) %!d(string=hai) anos
pai
achega
01a870e867

+ 3 - 1
mybatis-plus/src/main/java/com/baomidou/mybatisplus/plugins/PaginationInterceptor.java

@@ -124,8 +124,9 @@ public class PaginationInterceptor implements Interceptor {
 	protected void count(String sql, MappedStatement mappedStatement, BoundSql boundSql, Pagination page) {
 		PreparedStatement statement = null;
 		ResultSet resultSet = null;
+		Connection connection = null;
 		try {
-			Connection connection = mappedStatement.getConfiguration().getEnvironment().getDataSource().getConnection();
+			connection = mappedStatement.getConfiguration().getEnvironment().getDataSource().getConnection();
 			statement = connection.prepareStatement(sql);
 			DefaultParameterHandler parameterHandler = new MybatisDefaultParameterHandler(mappedStatement,
 					boundSql.getParameterObject(), boundSql);
@@ -148,6 +149,7 @@ public class PaginationInterceptor implements Interceptor {
 		} finally {
 			IOUtils.closeQuietly(statement);
 			IOUtils.closeQuietly(resultSet);
+			IOUtils.closeQuietly(connection);
 		}
 	}