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

Maryann Xue commented on PHOENIX-89:
------------------------------------

[~giacomotaylor] The reason why I considered the latter approach was better was 
that "executeStatement()" is also a member function of PhoenixConnection, just 
like "createStatement()" and "prepareStatement()" and the behavior should be 
kept consistent. But looks there's no way right now to get the statements 
created in this call. 
So I think as an alternative to former approach (close all the statements 
before exiting the call), we can change the signature of this method call and 
return a list of the statements created by this call and let the outer loop 
handle the lifecycle of those statements, just like using "createStatement()" 
and "prepareStatement()". What do you think?

{code}
public List<Statement> executeStatements(Reader reader, List<Object> binds, 
PrintStream out) throws IOException, SQLException
{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