DB006 : Could not acquire change log lock

DB006 : Could not acquire change log lock

Symptoms

When saving the database configuration in the 360Suite Administration Console, the following error message appears:
  1. DB006 : Could not acquire change log lock

Cause

When the application is upgraded, the database structure is updated (new tables and/or columns are added or some old ones are removed).
360Suite needs to ensure that the database structure meets the needs of the application for the new version.
For that, 360Suite uses an external library called Liquibase. To avoid running multiple updates simultaneously, this tool creates sort a lock for itself on the database then processes the update.

For some reason (may be a network issue, even a short one), if this lock is not released when the schema update is finished, it will remain, hence the error message.
It can be verified by running the below command on the 360Suite database:
  1. SELECT * FROM databasechangeloglock;
This will return the content of a table with a single line, and

Resolution

To unlock the 360Suite database, use the following SQL query on the database used for 360Suite:
  1. UPDATE DATABASECHANGELOGLOCK SET LOCKED=0
After running this request and making sure the transaction was committed, the database configuration in 360Suite needs to be saved again in the Administration Console.
AlertWarning : only run this query if you are 100% sure that the application database shouldn't be blocked.
The use of this lock is typicaly useful in a clustered configuration, to avoid having all nodes trying to update the database structure at the same time.

References

  1. What is the DATABASECHANGELOGLOCK table?
  2. COMMIT – SQL Tutorial