github-actions[bot] opened a new pull request, #43105:
URL: https://github.com/apache/doris/pull/43105

   PR Body: This pull request optimizes the JDBC connection and resource 
management in `JdbcClient` and related methods. The main changes are as follows:
   
   - **Manual Resource Closing**: Explicitly place resource acquisition and 
closing within a `try-catch-finally` structure. In the `finally` block, 
manually close resources like `Connection`, `Statement`, and `ResultSet` to 
ensure that resources are properly released even if an exception occurs.
   
   - **Remove try-with-resources**: All usages of `try-with-resources` have 
been removed, switching to manual resource management instead.
   
   - **Improve Exception Handling**: When closing resources, if an exception 
occurs, log a warning but do not throw a new exception. This avoids masking the 
original exception during the resource release phase.
   
   - **Unified Resource Management**: Ensure consistent resource acquisition 
and closing methods across all functions, improving code readability and 
maintainability.
   
   Functions modified include but are not limited to:
   
   - `executeStmt`
   - `getColumnsFromQuery`
   - `getDatabaseNameList`
   - `getJdbcColumnsInfo`
   - `processTable`
   - `getColumnsDataTypeUseQuery`
   
   These changes enhance the robustness of the code, prevent potential resource 
leaks, and ensure that all JDBC connections and resources are properly closed 
without using `try-with-resources`. 
    Cherry-picked from #43059


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to