Skip to content

Commit

Permalink
Resets changelog cache upon acquiring lock (#3396)
Browse files Browse the repository at this point in the history
* Resets changelog cache after acquiring lock to be sure that it's using the latest information from database.
  • Loading branch information
filipelautert committed Nov 8, 2022
1 parent 6eb2c14 commit 5a95752
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions liquibase-core/src/main/java/liquibase/Liquibase.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import liquibase.parser.ChangeLogParser;
import liquibase.parser.ChangeLogParserFactory;
import liquibase.parser.core.xml.XMLChangeLogSAXParser;
import liquibase.resource.InputStreamList;
import liquibase.resource.PathHandlerFactory;
import liquibase.resource.Resource;
import liquibase.resource.ResourceAccessor;
Expand Down Expand Up @@ -234,7 +233,6 @@ public void update(Contexts contexts, LabelExpression labelExpression) throws Li
*/
public void update(Contexts contexts, LabelExpression labelExpression, boolean checkLiquibaseTables) throws LiquibaseException {
runInScope(() -> {

LockService lockService = LockServiceFactory.getInstance().getLockService(database);
lockService.waitForLock();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ public boolean acquireLock() throws LockException {

hasChangeLogLock = true;

ChangeLogHistoryServiceFactory.getInstance().resetAll();
database.setCanCacheLiquibaseTableInfo(true);
return true;
}
Expand Down

0 comments on commit 5a95752

Please sign in to comment.