You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/04/18 19:58:24 UTC

[GitHub] [nifi] patricker commented on a change in pull request #3410: NIFI-6100 Use setBytes in JdbcCommon for binary types

patricker commented on a change in pull request #3410: NIFI-6100 Use setBytes in JdbcCommon for binary types
URL: https://github.com/apache/nifi/pull/3410#discussion_r276811893
 
 

 ##########
 File path: nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/src/main/java/org/apache/nifi/util/db/JdbcCommon.java
 ##########
 @@ -807,7 +807,7 @@ public static void setParameter(final PreparedStatement stmt, final String attrN
                             throw new ParseException("Unable to parse binary data using the formatter `" + valueFormat + "`.",0);
                     }
 
-                    stmt.setBinaryStream(parameterIndex, new ByteArrayInputStream(bValue), bValue.length);
+                    stmt.setBytes(parameterIndex, bValue);
 
 Review comment:
   I agree, keeping the old one with a failover would be a better solution. The only thing that sucks is you'll be catching the exception for every row, and then switching to the alternate. I suppose alternatively you could put a flag, and set the flag on first exception...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services