zhaojinchao95 opened a new issue, #22441:
URL: https://github.com/apache/shardingsphere/issues/22441

   `master` 
https://github.com/apache/shardingsphere/commit/a9c3c1878e1e1e0d73656f1c3537f34608ead815
   
   I think the ResultSet need to with `try-with-resource`. Because if not close 
in time, The resources held by resultSet will not be released until the `GC`. 
   
   For example : 
   
   ```
    private ExecuteResult executeSQL(final String sql, final Statement 
statement, final ConnectionMode connectionMode, final boolean withMetaData, 
final DatabaseType storageType) throws SQLException {
           databaseCommunicationEngine.add(statement);
           if (execute(sql, statement, isReturnGeneratedKeys)) {
               ResultSet resultSet = statement.getResultSet();
               databaseCommunicationEngine.add(resultSet);
               return createQueryResult(resultSet, connectionMode, storageType);
           }
           return new UpdateResult(statement.getUpdateCount(), 
isReturnGeneratedKeys ? getGeneratedKey(statement) : 0L);
       }
   ```
   
   ```
       private long getGeneratedKey(final Statement statement) throws 
SQLException {
           ResultSet resultSet = statement.getGeneratedKeys();
           return resultSet.next() ? getGeneratedKeyIfInteger(resultSet) : 0L;
       }
   ```
   
   This is just a part, there are many places


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to