[ 
https://issues.apache.org/jira/browse/HIVE-7225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Gates updated HIVE-7225:
-----------------------------

    Status: Open  (was: Patch Available)

Steve, thanks for the patch.  A few comments:
I don't think there's a need to explicitly close the ResultSet.  According to 
the JavaDocs on Statement.close(), it closes any associated ResultSets.  So 
making this call seems like a waste of time.
If we're going to do this, it should be done in CompactionTxnHanlder as well, 
since that subclasses this class and uses all of the same methods.
But that if leads to my last comment.  Is this necessary at all?  All of the 
public methods close the db connection as soon as they are done.  Is there any 
value to closing the individual statements in that collection first?

> Unclosed Statement's in TxnHandler
> ----------------------------------
>
>                 Key: HIVE-7225
>                 URL: https://issues.apache.org/jira/browse/HIVE-7225
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: steve, Oh
>         Attachments: HIVE-7225.1.patch
>
>
> There're several methods in TxnHandler where Statement (local to the method) 
> is not closed upon return.
> Here're a few examples:
> In compact():
> {code}
>         stmt.executeUpdate(s);
>         LOG.debug("Going to commit");
>         dbConn.commit();
> {code}
> In showCompact():
> {code}
>       Statement stmt = dbConn.createStatement();
>       String s = "select cq_database, cq_table, cq_partition, cq_state, 
> cq_type, cq_worker_id, " +
>           "cq_start, cq_run_as from COMPACTION_QUEUE";
>       LOG.debug("Going to execute query <" + s + ">");
>       ResultSet rs = stmt.executeQuery(s);
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to