[ 
https://issues.apache.org/jira/browse/CALCITE-6207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882687#comment-17882687
 ] 

Ruben Q L commented on CALCITE-6207:
------------------------------------

I'd argue the proposed change was improving code's readability and 
maintainability, so I'd be +1 on the change.

bq. If connection.getMetaData() or dialectFactory.create(metaData) throws an 
exception and then connection.close() throws an exception, your logic would 
throw the exception from connection.close(), but the current logic would throw 
the original exception.
I might be wrong but wouldn't we have in that case with the new logic the 
original exception too, with the close exception suppressed inside of it? (per 
"Supressed exceptions" here 
https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)

> Improve connection resource in JDBCUtils
> ----------------------------------------
>
>                 Key: CALCITE-6207
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6207
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: xy
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> Improve JDBC connection resource in JDBCUtils: not need multiple judge 
> connection whether close



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to