You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Alessandro Polselli (Jira)" <ji...@apache.org> on 2023/10/12 10:00:00 UTC

[jira] [Commented] (NIFI-12217) In PutDatabaseRecord processor, when you try to insert a CLOB and a SQLException gets catched, the exception message gets lost

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

Alessandro Polselli commented on NIFI-12217:
--------------------------------------------

The
{code:java}
                } catch (SQLException e) {
                    throw new IOException("Unable to parse data as CLOB/String " + value, e.getCause());
                }  {code}
was introduced by NIFI-6061

> In PutDatabaseRecord processor, when you try to insert a CLOB and a SQLException gets catched, the exception message gets lost
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-12217
>                 URL: https://issues.apache.org/jira/browse/NIFI-12217
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.23.2
>            Reporter: Alessandro Polselli
>            Priority: Trivial
>              Labels: putdatabaserecord
>
> In PutDatabaseRecord processor, when you try to insert a CLOB and a SQLException gets catched
> [https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java#L866C4-L866C4]
> the original Exception message (the most valuable part) gets completely lost, because only its .getCause() is wrapped in a generic IOException that states "Unable to parse data as CLOB/String", making it extremely difficult to identify which is the real problem.
> In my case, the problem was something like "ORA-25153: Tablespace temporanea vuota" but this valuable message wasn't logged at all.
>  
> I suggest to replace 
> {code:java}
>                 } catch (SQLException e) {
>                     throw new IOException("Unable to parse data as CLOB/String " + value, e.getCause());
>                 } {code}
> with
> {code:java}
>                 } catch (SQLException e) {
>                     throw new IOException("Unable to parse data as CLOB/String " + value, e);
>                 } {code}
>  
> Thank you



--
This message was sent by Atlassian Jira
(v8.20.10#820010)