Uploaded image for project: 'Liquibase Core'
  1. CORE-3396

Unable to generate Change Log for our smallest database

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects versions: 3.6.3
    • Fix versions: None
    • Components: Database Support
    • Environment:

      Informix 12.10.FC9DE on MacOSX

    • Sprint:

      Description

      We have 5 databases that we'd like to change control. I tried to generateChangeLog on the smallest one, and it fails:

      liquibase --url="jdbc:informix-sqli:INFORMIXSERVER=informix01_tcp;SQLH_TYPE=FILE;SQLH_FILE=/opt/informix/informix/etc/sqlhosts;DATABASE=wallet" --logLevel=severe --logFile=./lb.log --classpath=/opt/informix/informix/jdbc/lib/ifxjdbc.jar --changeLogFile ./test1ChangeLog.xml --includeTablespace=true generateChangeLog
      Starting Liquibase at Thu, 07 Mar 2019 13:27:07 GMT (version 3.6.3 built at 2019-01-29 11:34:48)
      Unexpected error running Liquibase: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: The cursor has been previously released and is unavailable.
      liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: The cursor has been previously released and is unavailable.
      	at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:279)
      	at liquibase.integration.commandline.Main.doMigration(Main.java:1058)
      	at liquibase.integration.commandline.Main.run(Main.java:199)
      	at liquibase.integration.commandline.Main.main(Main.java:137)
      Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: The cursor has been previously released and is unavailable.
      	at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
      	at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:277)
      	... 3 common frames omitted
      Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: The cursor has been previously released and is unavailable.
      	at liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:223)
      	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)
      	at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
      	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
      	at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
      	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
      	at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
      	at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:286)
      	at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:407)
      	at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:334)
      	at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:309)
      	at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:407)
      	at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:429)
      	at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:334)
      	at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:309)
      	at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:102)
      	at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:59)
      	at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:38)
      	at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:217)
      	at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:190)
      	at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:221)
      	at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:143)
      	at liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:46)
      	at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
      	... 4 common frames omitted
      Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: The cursor has been previously released and is unavailable.
      	at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:101)
      	at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData.getForeignKeys(JdbcDatabaseSnapshot.java:74)
      	at liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:127)
      	... 27 common frames omitted
      Caused by: java.sql.SQLException: The cursor has been previously released and is unavailable.
      	at com.informix.util.IfxErrMsg.buildException(IfxErrMsg.java:474)
      	at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:443)
      	at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:394)
      	at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3191)
      	at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3472)
      	at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2379)
      	at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2304)
      	at com.informix.jdbc.IfxSqli.executeFetch(IfxSqli.java:2038)
      	at com.informix.jdbc.IfxSqli.getaRow(IfxSqli.java:4082)
      	at com.informix.jdbc.IfxResultSet.next(IfxResultSet.java:494)
      	at com.informix.jdbc.IfxDatabaseMetaData.getImportedKeys(IfxDatabaseMetaData.java:5389)
      	at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData$1.fastFetch(JdbcDatabaseSnapshot.java:126)
      	at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:70)
      	... 29 common frames omitted
      Caused by: java.sql.SQLException: null
      	at com.informix.util.IfxErrMsg.buildException(IfxErrMsg.java:474)
      	at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:443)
      	at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:394)
      	at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3477)
      	... 37 common frames omitted
      
      
      For more information, please use the --logLevel flag
      

      I can't get --logLevel to do anything either, I must be missing something, so I had to try about 100 lines of the schema at a time until it fell over. I then approached the failing object one change at a time.

      The error occurs if you have more than 2 foreign keys.

      I didn't test for more than 2 of any other kind of constraint.

        Attachments

          Activity

            People

            • Reporter:
              william.wheeler William Wheeler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: