[
https://issues.apache.org/jira/browse/NIFI-10657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838399#comment-17838399
]
ASF subversion and git services commented on NIFI-10657:
--------------------------------------------------------
Commit 49241735927349bceac364062062f6a5fb1978ba in nifi's branch
refs/heads/support/nifi-1.x from Jim Steinebrey
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=4924173592 ]
Free Clob after reading from ResultSet
NIFI-10657 Added debug logging when unable to free clob or blob because it is
unsupported
Signed-off-by: Joe Gresock <[email protected]>
This closes #8654.
> 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, Docker
> Affects Versions: 1.17.0
> Environment: Docker container
> Reporter: Shiv
> Assignee: Jim Steinebrey
> Priority: Major
> Labels: performance
> Time Spent: 40m
> Remaining Estimate: 0h
>
> 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)