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

Alexander Kolbasov commented on HIVE-16213:
-------------------------------------------

I am not 100% sure, but I think I saw exceptions from rollbackTransaction() 
sometime back. There is 
http://www.datanucleus.org/javadocs/core/2.2/org/datanucleus/exceptions/RollbackStateTransitionException.html
 as well. I noticed that several DataNucleus methods do not document exceptions 
that can be thrown from them.

Is there an explicit documentation that states that rollbackTransaction() will 
never throw an exception?

> ObjectStore can leak Queries when rolbackTransaction 
> -----------------------------------------------------
>
>                 Key: HIVE-16213
>                 URL: https://issues.apache.org/jira/browse/HIVE-16213
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Alexander Kolbasov
>            Assignee: Vihang Karajgaonkar
>
> In ObjectStore.java there are a few places with the code similar to:
> {code}
>     Query query = null;
>     try {
>       openTransaction();
>       query = pm.newQuery(Something.class);
>       ...
>       commited = commitTransaction();
>     } finally {
>       if (!commited) {
>         rollbackTransaction();
>       }
>       if (query != null) {
>         query.closeAll();
>       }
>     }
> {code}
> The problem is that rollbackTransaction() may throw an exception in which 
> case query.closeAll() wouldn't be executed. 
> The fix would be to wrap rollbackTransaction in its own try-catch block.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to