[ 
https://issues.apache.org/jira/browse/NIFI-10657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shiv updated NIFI-10657:
------------------------
    Labels: performance  (was: performance pull-request-available)

> When multiple CLOB columns in a table are configured for processing in 
> Oracle, NIFI is throwing Out of Memory exception.
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-10657
>                 URL: https://issues.apache.org/jira/browse/NIFI-10657
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.17.0
>         Environment: Docker container
>            Reporter: Shiv
>            Priority: Major
>              Labels: performance
>
> This issue is happening because Nifi Processor PutDatabaseRecord is not 
> clearing CLOBs once the data is written to the databases. The Nifi Processor 
> code needs to be modified to clear CLOB before closing Resultsets.
> Table being processed has four CLOB data type columns. Average row size is 
> 10K, and each CLOB column average length is 2K
> I don't have the permission to create a branch.. The below code change is 
> needed to fix the issue *(tested against rel/nifi-1.17.0 branch)*
> {code:java}
> diff --git 
> a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
>  
> b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
> index b78408c912..bfc5328603 100644
> --- 
> a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
> +++ 
> b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
> @@ -280,6 +280,11 @@ public class JdbcCommon {
>                                  }
>                              }
>                              rec.put(i - 1, sb.toString());
> +                            try {
> +                               clob.free();
> +                           } catch (SQLFeatureNotSupportedException sfnse) {
> +                              // The driver doesn't support free, but allow 
> processing to continue
> +                           }
>                          } else {
>                              rec.put(i - 1, null);
>                          } {code}



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

Reply via email to