You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Billy(Yiming) Liu (JIRA)" <ji...@apache.org> on 2016/09/25 13:05:20 UTC

[jira] [Commented] (KYLIN-2050) Potentially ineffective call to close() in QueryCli

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

Billy(Yiming) Liu commented on KYLIN-2050:
------------------------------------------

The patch is ready for review. Has changed most resource close method to DBUtils.closeQuietly or IOUtils.closeQuietly in the finally block.

> Potentially ineffective call to close() in QueryCli
> ---------------------------------------------------
>
>                 Key: KYLIN-2050
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2050
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Billy(Yiming) Liu
>            Priority: Minor
>         Attachments: KYLIN-2050
>
>
> Here is related code:
> {code}
>         } finally {
>             if (rs != null) {
>                 rs.close();
>             }
>             if (stmt != null) {
>                 stmt.close();
>             }
>             if (conn != null) {
>                 conn.close();
>             }
>         }
> {code}
> If the first or second close() throws exception, the subsequent close() would be skipped.
> This pattern may appear in other class(es).
> See http://stackoverflow.com/questions/2225221/closing-database-connections-in-java



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)