hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Francke (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-7863) Potential null reference in TxnDbUtil#prepareDb()
Date Tue, 02 Sep 2014 21:21:22 GMT

     [ https://issues.apache.org/jira/browse/HIVE-7863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lars Francke updated HIVE-7863:
-------------------------------
    Attachment: HIVE-7863.1.patch

This fixes the issue. I've taken the liberty to clean up the class at the same time. I'm happy
to change the title of this issue or create a separate one.

> Potential null reference in TxnDbUtil#prepareDb()
> -------------------------------------------------
>
>                 Key: HIVE-7863
>                 URL: https://issues.apache.org/jira/browse/HIVE-7863
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Lars Francke
>            Priority: Minor
>         Attachments: HIVE-7863.1.patch
>
>
> Here is related code:
> {code}
>     Connection conn = null;
>     boolean committed = false;
>     try {
>       conn = getConnection();
> ...
>     } finally {
>       if (!committed) conn.rollback();
>       conn.close();
>     }
> {code}
> If getConnection() throws exception, conn.rollback() would be called - leading to NPE.



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

Mime
View raw message