listLocks command

listLocks returns the hostname, IP address, and the timestamp the Liquibase lock record was added to the DATABASECHANGELOGLOCK table.

Uses

listLocks is typically used when an error occurs during a database deployment. The error might indicate that there is a lock record in the DATABASECHANGELOG table by another user that is preventing Liquibase from applying changes to the specified database.

listLocks will read the DATABASECHANGELOGLOCK table and return a list that includes the hostname, IP address, and the timestamp the lock record was granted to the DATABASECHANGELOG table and determines the connections to the DATABASECHANGELOG table based on the database URL.

Running the listLocks command

To run the listLocks command, you need to specify your driver, class path, URL, and user authentication information in your liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these properties in your command line.

Then run the listLocks command:

liquibase –-changeLogFile=mainchangelog.xml listLocks

Note: Enter the name of the changelog you want to use in place of main-changelog.xml. You can also add the changeLogFile to your liquibase.properties file

listLocks global attributes

Attribute Definition Requirement
--changeLogFile The root changelog Required
--username The database username Required
--password The database password Required
--url The JDBC database connection Required