Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8831

Using MS SQL Server for the metadata database does not work.

    XMLWordPrintableJSON

Details

    Description

      When NiFi registry is configured to store metadata in a MS SQL Server database, attempts to start it fail with the following exception:

       

      2019-03-12 11:22:00,234 ERROR [main] o.a.n.r.db.CustomFlywayMigrationStrategy The result set is closed.
      com.microsoft.sqlserver.jdbc.SQLServerException: The result set is closed.
          at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:226) ~[mssql-jdbc-7.0.0.jre8.jar:na]
          at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(SQLServerResultSet.java:444) ~[mssql-jdbc-7.0.0.jre8.jar:na]
          at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:981) ~[mssql-jdbc-7.0.0.jre8.jar:na]
          at org.apache.nifi.registry.db.CustomFlywayMigrationStrategy.isNewDatabase(CustomFlywayMigrationStrategy.java:109) [nifi-registry-framework-0.3.0.jar:0.3.0]
          at org.apache.nifi.registry.db.CustomFlywayMigrationStrategy.migrate(CustomFlywayMigrationStrategy.java:64) [nifi-registry-framework-0.3.0.jar:0.3.0]

      The problem here is that CustomFlywayMigrationStrategy.isNewDatabase() tries to use two ResultSet instances at the same time. That does not work, because when connection.getMetaData().getTables(...) is called for the second time, the first result set is automatically closed.

      Note: The issue has been discovered in version 0.3.0, but the relevant code in the current master branch is not changed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sfzhi Sergei Zhirikov
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m