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

James Taylor commented on PHOENIX-89:
-------------------------------------

How about adding a try/finally block to PhoenixConnection.executeStatements(), 
and then just not addin the Statement to the Connection at all:
{code}
                PhoenixPreparedStatement stmt = new 
PhoenixPreparedStatement(this, parser);
                // remove: this.statements.add(stmt);
                try {
                } finally {
                    stmt.close();
                }
{code}


> Statements are not closed using PhoenixConnection.executeStatements()
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-89
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-89
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 2.2.3, 3.0.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> This method is mainly used by "PhoenixRuntime#main()", which is a Phoenix 
> java utility class for executing SQL scripts.
> We can either close the statements locally inside the method, or add the 
> statements into the statement list of the enclosing PhoenixConnection. I 
> prefer the latter.



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

Reply via email to