Liquibase liquibase = getLiquibase(changelogFile, null); database = liquibase.getDatabase(); List<ChangeSet> changeSets = liquibase.listUnrunChangeSets(CONTEXT);
/** * This method currently checks the liquibasechangeloglock table to see if there is a row * with a lock in it. This uses the liquibase API to do this * * @return true if database is currently locked */ public static boolean isLocked() { Database database = null; try { Liquibase liquibase = getLiquibase(null, null); database = liquibase.getDatabase(); return LockService.getInstance(database).listLocks().length > 0; } catch (Exception e) { return false; } finally { try { database.getConnection().close(); } catch (Exception e) { // pass } } } }
Liquibase liquibase = getLiquibase(CHANGE_LOG_FILE, null); database = liquibase.getDatabase(); DatabaseChangeLog changeLog = new XMLChangeLogSAXParser().parse(CHANGE_LOG_FILE, new ChangeLogParameters(),
/** * Interface used for callbacks when updating the database. Implement this interface and pass it * to {@link DatabaseUpdater#executeChangelog(String, Map, ChangeSetExecutorCallback)} */ public interface ChangeSetExecutorCallback { /** * This method is called after each changeset is executed. * * @param changeSet the liquibase changeset that was just run * @param numChangeSetsToRun the total number of changesets in the current file */ public void executing(ChangeSet changeSet, int numChangeSetsToRun); }
Liquibase liquibase = getLiquibase(null, null); database = liquibase.getDatabase(); if (database.hasDatabaseChangeLogLockTable() && isLocked()) {