changelog-lock-poll-rate global parameter is an integer that sets the number of seconds Liquibase waits to check if a Working with Changelogs lock has been released. The default value is
The DATABASECHANGELOGLOCK table only allows a single instance of Liquibase to run at a time. This prevents conflicts between multiple developers working at the same time or multiple servers in a cluster that auto-run Liquibase on startup.
DATABASECHANGELOGLOCK has a column named
LOCKED that is set to
1 while Liquibase is running and
0 otherwise. If you try to run Liquibase while the lock record is active, the following message is printed to
Waiting for changelog lock....
This message repeats until
LOCKED is set to
0. The number of seconds Liquibase waits before checking the lock status at each interval is determined by the value of
If you need to run multiple database updates at once and want to minimize the amount of unused time between deployments, you can lower the value of
changelog-lock-poll-rate. This way, Liquibase will check more frequently whether the changelog lock has been released.
If you need to limit system resources, or if you know that the changelog lock will be active for a long time, you can raise the value of
Setting the parameter
You can set in four ways:
- In the Liquibase properties file
- As a global parameter in the CLI
- As a JVM system property
- As an environment variable (Liquibase Pro)
Liquibase properties file parameter
In Liquibase 4.1+, add the following to Liquibase properties file:
CLI global parameter
Tip: All commands and parameters use the
--kebab-case format in the CLI environment. This is the format Liquibase recommends for best results. If your preference is camelCase, it will still work in the CLI.
In your command line, use a global parameter with a single Liquibase command:
Java system property
In your command line, use the JAVA_OPTS Environment Variable to set a JVM system property:
Note: To use a Liquibase command alongside
&& liquibase <command> to the end of your input.
Environment variable (Liquibase Pro)
In Liquibase Pro, set an environment variable:
Note: These environment variable commands only apply to the current shell. If you need to pass an environment variable to a child process without affecting the parent process, you can use the
export command on Mac/Linux or the
setx command on Windows.