How can we help you today? How can we help you today?

Limitation on number of lines in FlywayScript

We are issue where our pipelines fails and throws error when we try to execute any script (Procedures) on the PostgreSQL DB (ATS FTEST) where the total character in the script exceeds 16330 characters in FLYWAY. We are using community edition 7.4.  We also tried to find other alternatives nothing seems to work as this seems to be number of character limitation to get processed by BB/Flyway.

Just wanted to make a note this limitation will be applicable to code scripts like Procedures, functions, Views, Triggers, etc and what the limitation on number of lines is ?  We wanted to know if you'll have faced such issues with other clients and how was it solved. We also want to know if there are alternative solution without doing any upgrade or going to commercial edition.  also wanted to know if this is solved in higher version or enterprise edition and what's the limitation there,

santosh_malimath
0

Comments

7 comments

  • AlistairW
    We are not aware of any such limitation but it's hard to know exactly what is going on from what you have provided. What is the error you get back from Flyway ? How are you providing the script (e.g. file ?)
    AlistairW
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate. 
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate. 
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate.
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141)
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141)
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141)
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate. 
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate. 
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0
  • santosh_malimath
    We are running a SQL file which has procedure in it and gives the following error when we run flyway migrate. 
    Unable to rollback transaction
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:872)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:82)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Unable to restore autocommit to original value for connection
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:794)
    at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:97)
    at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:325)
    at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:290)
    at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:56)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:194)
    at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:191)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    ERROR: Migration of schema "ds_local" to version "2501171909 - OTP TestRun" failed! Changes successfully rolled back.
    ERROR: Unable to release PostgreSQL advisory lock
    org.postgresql.util.PSQLException: This connection has been closed.
    at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:865)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1771)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:418)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.prepareStatement(JdbcTemplate.java:344)
    at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForBoolean(JdbcTemplate.java:170)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.unlock(PostgreSQLAdvisoryLockTemplate.java:99)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:80)
    at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
    at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) 
    at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:191)
    at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:152)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:216)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:165)
    at org.flywaydb.core.Flyway.execute(Flyway.java:570)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:165)
    at org.flywaydb.commandline.Main.executeOperation(Main.java:223)
    at org.flywaydb.commandline.Main.main(Main.java:144)
    santosh_malimath
    0

Add comment

Please sign in to leave a comment.