[ https://issues.apache.org/jira/browse/HIVE-7182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025947#comment-14025947 ]
steve, Oh commented on HIVE-7182: --------------------------------- executeUpdate wasn't moved outside the if. I moved stmt.close() & closeConnection() finally block. {noformat} if (!tblExists) { // Table does not exist, create it String createTable = JDBCStatsUtils.getCreate(""); - stmt.executeUpdate(createTable); - stmt.close(); - } - closeConnection(); + stmt.executeUpdate(createTable); + } {noformat} > ResultSet is not closed in JDBCStatsPublisher#init() > ---------------------------------------------------- > > Key: HIVE-7182 > URL: https://issues.apache.org/jira/browse/HIVE-7182 > Project: Hive > Issue Type: Bug > Reporter: Ted Yu > Priority: Minor > Attachments: HIVE-7182.patch > > > {code} > ResultSet rs = dbm.getTables(null, null, > JDBCStatsUtils.getStatTableName(), null); > boolean tblExists = rs.next(); > {code} > rs is not closed upon return from init() > If stmt.executeUpdate() throws exception, stmt.close() would be skipped - the > close() call should be placed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)