4

I made a change to a Grails domain class and ran

grails db-gorm-diff 2012-11-20-domain-class-change.groovy --add (obviously with another name there)

and was getting a “change lock” error from Liquibase:

Error executing bootstraps: liquibase.exception.LockException: Could not acquire change log lock. Currently locked by computer-name.local […]

So (stupidly, it seems) following the advice in an aged thread dealing with a similar problem with the Autobase plugin, I deleted the rows in the change log lock table:

mysql> delete from DATABASECHANGELOGLOCK;

and now get this beautiful Liquibase error:

Error executing bootstraps: liquibase.exception.DatabaseException: Empty result set, expected one row

which clearly tells me, too late to change this, that I shouldn’t have deleted that row from the table.

What can I do about this now?

Ben Klein
  • 1,719
  • 3
  • 18
  • 41

3 Answers3

4

There is a script for this in the plugin - use http://grails-plugins.github.com/grails-database-migration/docs/manual/ref/Maintenance%20Scripts/dbm-release-locks.html

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
3

I dug around some more in general Liquibase-related places and now learn that I can simply drop the table altogether and have it recreated on startup. This seems to have worked.

Ben Klein
  • 1,719
  • 3
  • 18
  • 41
2

Look at http://forum.liquibase.org/topic/message-regarding-an-empty-result-set-for-databasechangeloglock . You just need to set 'locked' row to 1 or to drop databasechangelock table entirely (it will be recreated then)

gis_wild
  • 464
  • 8
  • 24