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

Raju Bairishetti commented on LENS-953:
---------------------------------------

Looks like db connection is not getting closed in case of exceptions on query 
execution. Can you move **conn** and **stmt** to finally block to make sure db 
connection is getting closed always?


{code}
  statement.executeUpdate(line);
    }
    statement.execute("SHUTDOWN");
    statement.close();
    con.close();
{code}


> Unclosed InputStream in DatabaseUtil#initializeDatabaseStorage()
> ----------------------------------------------------------------
>
>                 Key: LENS-953
>                 URL: https://issues.apache.org/jira/browse/LENS-953
>             Project: Apache Lens
>          Issue Type: Bug
>          Components: client
>            Reporter: Ted Yu
>            Assignee: Ajay Yadava
>            Priority: Minor
>         Attachments: LENS-953.patch
>
>
> Here is related code:
> {code}
>     InputStream file = 
> DatabaseUtil.class.getClassLoader().getResourceAsStream("db-storage-schema.sql");
>     BufferedReader reader = new BufferedReader(new InputStreamReader(file, 
> "UTF-8"));
> {code}
> Neither file nor reader is closed upon exit from the method.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to