You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "rajeshbabu (JIRA)" <ji...@apache.org> on 2014/10/21 11:11:33 UTC
[jira] [Commented] (PHOENIX-1364) Fix resource leaks in various
classes
[ https://issues.apache.org/jira/browse/PHOENIX-1364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14178165#comment-14178165 ]
rajeshbabu commented on PHOENIX-1364:
-------------------------------------
Patch lgtm +1
> Fix resource leaks in various classes
> -------------------------------------
>
> Key: PHOENIX-1364
> URL: https://issues.apache.org/jira/browse/PHOENIX-1364
> Project: Phoenix
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Ted Yu
> Attachments: fix-resource-leak-v1.txt
>
>
> Statement / PreparedStatement should be closed after query completes.
> Below is an example of resource leak from MetaDataUtil#deleteViewIndexSequences():
> {code}
> public static void deleteViewIndexSequences(PhoenixConnection connection, PName name) throws SQLException {
> SequenceKey key = getViewIndexSequenceKey(null, name);
> connection.createStatement().executeUpdate("DELETE FROM " + PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME +
> {code}
> The Statement created by connection.createStatement() should be closed upon return.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)