Liquibase锁定的原因?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (39)

我在运行大量针对Oracle服务器的liquibase脚本时遇到了这个问题。SomeComputer就是我。

Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Liquibase Update Failed: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
SEVERE 2013-03-20 16:59:liquibase: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
        at liquibase.lockservice.LockService.waitForLock(LockService.java:81)
        at liquibase.Liquibase.tag(Liquibase.java:507)
        at liquibase.integration.commandline.Main.doMigration(Main.java:643)
        at liquibase.integration.commandline.Main.main(Main.java:116)

提问于
用户回答回答于

这可能是由于一个杀死的liquibase进程没有释放它对DATABASECHANGELOGLOCK表的锁定。然后,

DELETE FROM DATABASECHANGELOGLOCK;

可能会帮助你。

用户回答回答于

有时如果更新应用程序突然停止,那么锁会保持卡住。

然后运行

UPDATE DATABASECHANGELOGLOCK SET LOCKED=FALSE, LOCKGRANTED=null, LOCKEDBY=null where ID=1;

或者你可以删除DATABASECHANGELOGLOCK表格,它会被重新创建。

扫码关注云+社区