mattyb149 commented on code in PR #8534:
URL: https://github.com/apache/nifi/pull/8534#discussion_r1533752157


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractQueryDatabaseTable.java:
##########
@@ -343,6 +362,24 @@ public void onTrigger(final ProcessContext context, final 
ProcessSessionFactory
             if (logger.isDebugEnabled()) {
                 logger.debug("Executing query {}", new Object[] { selectQuery 
});
             }
+
+            final boolean originalAutoCommit = con.getAutoCommit();
+            final Boolean propertyAutoCommitValue = 
context.getProperty(AUTO_COMMIT).evaluateAttributeExpressions().asBoolean();
+            // If user sets AUTO_COMMIT property to non-null (i.e. true or 
false), then the property value overrides the dbAdapter's value
+            final Boolean setAutoCommitValue =
+                    dbAdapter == null || propertyAutoCommitValue != null
+                            ? propertyAutoCommitValue
+                            : 
dbAdapter.getAutoCommitForReads(fetchSize).orElse(null);
+            if (setAutoCommitValue != null && originalAutoCommit != 
setAutoCommitValue) {

Review Comment:
   We should add logic to customValidate to check  the property setting against 
the adapter setting and mark the processor invalid if they don't match (if 
Fetch Size is non-zero). It's very little risk to current users because their 
current flows wouldn't work correctly anyway.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to