[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7338: NIFI-11631 Add OracleDB support for Nifi Registry

2023-06-14 Thread via GitHub


exceptionfactory commented on code in PR #7338:
URL: https://github.com/apache/nifi/pull/7338#discussion_r1230016163


##
nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java:
##
@@ -391,8 +391,12 @@ public FlowSnapshotEntity getFlowSnapshot(final String 
flowIdentifier, final Int
 
 @Override
 public FlowSnapshotEntity getLatestSnapshot(final String flowIdentifier) {
-final String sql = "SELECT * FROM FLOW_SNAPSHOT WHERE flow_id = ? 
ORDER BY version DESC LIMIT 1";
-
+final String sql;
+if (jdbcTemplate.getDataSource() instanceof OracleCommonDataSource) {

Review Comment:
   @dam4rus I think we need to take a step back, as we cannot go forward with 
either Oracle or MSSQL as they stand. This pull request would introduce a 
direct dependency on Oracle, which is not an option.
   
   It sounds like the best approach is to take a step back as @bbende suggested 
and consider an abstraction approach, then come back to consider Oracle and 
MSSQL using that abstraction.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7338: NIFI-11631 Add OracleDB support for Nifi Registry

2023-06-13 Thread via GitHub


exceptionfactory commented on code in PR #7338:
URL: https://github.com/apache/nifi/pull/7338#discussion_r1228650340


##
nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java:
##
@@ -16,7 +16,21 @@
  */
 package org.apache.nifi.registry.db;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import oracle.jdbc.datasource.OracleCommonDataSource;

Review Comment:
   Referencing this specific class is a problem for compatibility with other 
vendors, so a different approach is necessary to check for Oracle as the 
version.



##
nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/DatabaseMetadataService.java:
##
@@ -391,8 +391,12 @@ public FlowSnapshotEntity getFlowSnapshot(final String 
flowIdentifier, final Int
 
 @Override
 public FlowSnapshotEntity getLatestSnapshot(final String flowIdentifier) {
-final String sql = "SELECT * FROM FLOW_SNAPSHOT WHERE flow_id = ? 
ORDER BY version DESC LIMIT 1";
-
+final String sql;
+if (jdbcTemplate.getDataSource() instanceof OracleCommonDataSource) {

Review Comment:
   A different approach is needed to check for the use of Oracle.



##
nifi-registry/nifi-registry-core/nifi-registry-framework/pom.xml:
##
@@ -420,6 +420,11 @@
 
 
 
+
+com.oracle.database.jdbc
+ojdbc8
+23.2.0.0

Review Comment:
   This dependency should have the `test` scope.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org