You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/06/09 17:00:00 UTC

[jira] [Commented] (HIVE-23601) Hive Statement Clear Statement Handle on Error

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

David Mollitor commented on HIVE-23601:
---------------------------------------

[~ngangam] Can you please review my PR?  Thanks!

> Hive Statement Clear Statement Handle on Error
> ----------------------------------------------
>
>                 Key: HIVE-23601
>                 URL: https://issues.apache.org/jira/browse/HIVE-23601
>             Project: Hive
>          Issue Type: Bug
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:java}
>   private void closeStatementIfNeeded() throws SQLException {
>     try {
>       if (stmtHandle != null) {
>         TCloseOperationReq closeReq = new TCloseOperationReq(stmtHandle);
>         TCloseOperationResp closeResp = client.CloseOperation(closeReq);
>         Utils.verifySuccessWithInfo(closeResp.getStatus());
>         stmtHandle = null;
>       }
>     } catch (SQLException e) {
>       throw e;
>     } catch (Exception e) {
>       throw new SQLException("Failed to close statement", "08S01", e);
>     }
>   }
>  void closeClientOperation() throws SQLException {
>     closeStatementIfNeeded();
>     isQueryClosed = true;
>     stmtHandle = null;
>   }
> {code}
> {{verifySuccessWithInfo}} throws an {{Exception}} if it finds an error code and therefore leapfrogs over setting the statement handle to null (twice).  Probably not what is intended since the original author(s) are tried twice to null it out.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)