You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (Jira)" <ji...@apache.org> on 2022/03/16 15:10:00 UTC

[jira] [Created] (NIFI-9800) Unwrap SQLExceptions in PutDatabaseRecord when table does not exist

Matt Burgess created NIFI-9800:
----------------------------------

             Summary: Unwrap SQLExceptions in PutDatabaseRecord when table does not exist
                 Key: NIFI-9800
                 URL: https://issues.apache.org/jira/browse/NIFI-9800
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Extensions
            Reporter: Matt Burgess


As of NIFI-5757, SQLExceptions in PutDatabaseRecord's code to determine table information have been wrapped in a ProcessException as the code was moved into a lambda. Until NIFI-8146, this introduced a regression as the flowfile would be rolled back (even if Rollback on Failure is false) rather than being routed to failure.

The refactor of PutDatabaseRecord in NIFI-8146 changed the logic to correctly route to failure; however the exception is still wrapped in a ProcessException and should be unwrapped before logging. Behavior (transfer to failure) should remain the same and thus avoid another regression.

To test, simply send a flowfile to PutDatabaseRecord to a table that doesn't exist. In NiFi 1.8, it will be routed to failure. In NiFi 1.9-1.12, it will be rolled back. In 1.13+ it is again routed to failure. After this Jira, it should still be routed to failure but logged as a SQLException rather than a ProcessException with a SQLException cause.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)