*/
@Override
public void update(String contexts) throws LiquibaseException {
contexts = StringUtils.trimToNull(contexts);
LockServiceEx lockService = LockServiceEx.getInstance(database);
lockService.waitForLock();
try {
getChangeLogParameters().setContexts(StringUtils.splitAndTrim(contexts, ","));
DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance()
.getParser(this.changeLogFile, getFileOpener())
.parse(this.changeLogFile, getChangeLogParameters(), getFileOpener());
checkDatabaseChangeLogTable(true, changeLog, contexts);
changeLog.validate(database, contexts);
ChangeLogIterator changeLogIterator = getStandardChangelogIterator(contexts, changeLog);
changeLogIterator.run(new UpdateVisitor(database), database);
} finally {
try {
lockService.releaseLock();
} catch (LockException e) {
LOGGER.error("Error while releasing db lock", e);
}
}
}