You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2014/08/23 03:05:11 UTC
[jira] [Commented] (HIVE-7863) Potential null reference in
TxnDbUtil#prepareDb()
[ https://issues.apache.org/jira/browse/HIVE-7863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14107773#comment-14107773 ]
Ted Yu commented on HIVE-7863:
------------------------------
Same pattern appears in cleanDb() as well.
> 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
> Priority: Minor
>
> 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.2#6252)