if (database.hasDatabaseChangeLogLockTable()) {
executor.comment("Release Database Lock");
database.rollback();
int updatedRows = executor.update(new UnlockDatabaseChangeLogStatement());
if (updatedRows != 1) {
throw new LockException("Did not update change log lock correctly.\n\n"
+ updatedRows
+ " rows were updated instead of the expected 1 row using executor "
+ executor.getClass().getName()
+ " there are "
+ executor.queryForInt(new RawSqlStatement("select count(*) from "
+ database.getDatabaseChangeLogLockTableName())) + " rows in the table");
}
database.commit();
hasChangeLogLock = false;
instances.remove(this.database);
database.setCanCacheLiquibaseTableInfo(false);
LOGGER.info("Successfully released change log lock");
}
} catch (Exception e) {
throw new LockException(e);
} finally {
try {
database.rollback();
} catch (DatabaseException e) {
noOp();