jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3737) ConnectionHelper eating up original exception in execute
Date Fri, 28 Feb 2014 07:44:21 GMT

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

Chetan Mehrotra commented on JCR-3737:
--------------------------------------

Looking at the code not sure on the fix

# Pass the original exception as part of RuntimeException
# OR Implement support for STORE_TEMP_FILE in Journal also and create TempFileInputStream
from the InputStream as done in DbDataStore. Such that on retry the binary is used properly


> ConnectionHelper eating up original exception in execute
> --------------------------------------------------------
>
>                 Key: JCR-3737
>                 URL: https://issues.apache.org/jira/browse/JCR-3737
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.7.4
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>
> While inserting blob the ConnectionHelper tries to reset the InputStream [1]
> {code:java}
>  } catch (SQLException e) {
>          //Reset Stream for retry ...
>             for (int i = 0; params != null && i < params.length; i++) {
>                 Object p = params[i];
>                 if (p instanceof StreamWrapper) {
>                     StreamWrapper wrapper = (StreamWrapper) p;
>                     if(!wrapper.resetStream()) {
>                      wrapper.cleanupResources();
>                      throw new RuntimeException("Unable to reset the Stream.");
>                     }
>                 }
>             }
>          throw e;
>         }
> {code}
> In above code flow if there is an issue in resetting the StreamWrapper then original
exception would be lost.
> [1] https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java#L519



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message