use of liquibase.exception.LiquibaseException in project liquibase by liquibase.
the class Liquibase method update.
public void update(Contexts contexts, LabelExpression labelExpression, Writer output, boolean checkLiquibaseTables) throws LiquibaseException {
changeLogParameters.setContexts(contexts);
changeLogParameters.setLabels(labelExpression);
Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);
LoggingExecutor loggingExecutor = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);
ExecutorService.getInstance().setExecutor(database, loggingExecutor);
outputHeader("Update Database Script");
LockService lockService = LockServiceFactory.getInstance().getLockService(database);
lockService.waitForLock();
try {
update(contexts, labelExpression, checkLiquibaseTables);
output.flush();
} catch (IOException e) {
throw new LiquibaseException(e);
}
ExecutorService.getInstance().setExecutor(database, oldTemplate);
}
use of liquibase.exception.LiquibaseException in project liquibase by liquibase.
the class Liquibase method changeLogSync.
public void changeLogSync(Contexts contexts, LabelExpression labelExpression, Writer output) throws LiquibaseException {
changeLogParameters.setContexts(contexts);
changeLogParameters.setLabels(labelExpression);
LoggingExecutor outputTemplate = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);
Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);
ExecutorService.getInstance().setExecutor(database, outputTemplate);
outputHeader("SQL to add all changesets to database history table");
changeLogSync(contexts, labelExpression);
try {
output.flush();
} catch (IOException e) {
throw new LiquibaseException(e);
}
ExecutorService.getInstance().setExecutor(database, oldTemplate);
resetServices();
}
use of liquibase.exception.LiquibaseException in project liquibase by liquibase.
the class CDILiquibase method onStartup.
@PostConstruct
public void onStartup() {
log.info("Booting Liquibase " + LiquibaseUtil.getBuildVersion());
String hostName;
try {
hostName = NetUtil.getLocalHostName();
} catch (Exception e) {
log.warning("Cannot find hostname: " + e.getMessage());
log.debug("", e);
return;
}
LiquibaseConfiguration liquibaseConfiguration = LiquibaseConfiguration.getInstance();
if (!liquibaseConfiguration.getConfiguration(GlobalConfiguration.class).getShouldRun()) {
log.info("Liquibase did not run on " + hostName + " because " + liquibaseConfiguration.describeValueLookupLogic(GlobalConfiguration.class, GlobalConfiguration.SHOULD_RUN) + " was set to false");
return;
}
initialized = true;
try {
performUpdate();
} catch (LiquibaseException e) {
throw new UnexpectedLiquibaseException(e);
}
}
Aggregations