JAVA BUG
- JAVA BUG
- liquibase.lockservice锁异常
- 1、启动参数增加jvm参数 -Dliquibase.lockservice=false
- 2、修改或清空 包含有 DATABASECHANGELOGLOCK的表
JAVA BUG
该章收集工作中遇到的java bug,作为工作日志,方便回顾。
liquibase.lockservice锁异常
报错信息:Liquibase.exception.LockException:Could not acquire change log lock 或者 Could not acquire change log lock. Currently locked by DESKTOP-KQ19AGA (192.168.125.229) since 23-5-10 上午10:30
解决方案:
1、启动参数增加jvm参数 -Dliquibase.lockservice=false
禁用 liquibase.lockservice 【但是笔者在application.yml 中写了
spring:
liquibase:
enabled: true
change-log: classpath:/db/changelog/db.changelog-master.yaml
contexts: dev,test
lockservice:
enabled: false
仍然无效,或者在pom.xml中添加以下配置来设置 JVM 参数
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>
-Dliquibase.lockservice=false
</jvmArguments>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
也不行,不知道是不是我参数配置错误,,,】
2、修改或清空 包含有 DATABASECHANGELOGLOCK的表
网上搜到的方法是去数据库把 被锁的表清空或者改1为0
select * from DATABASECHANGELOGLOCK;
update DATABASECHANGELOGLOCK set LOCKED=“”, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
但是sql developer中没有 DATABASECHANGELOGLOCK 表,因此使用navicat premium客户端看到有带后缀 _DATABASECHANGELOGLOCK的表,因此把所有带lock后缀的表都改1为0
select * from ACT_ADM_DATABASECHANGELOGLOCK
update ACT_ADM_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_APP_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_CMMN_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_CO_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_DE_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_DMN_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update ACT_FO_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
update FLW_EV_DATABASECHANGELOGLOCK set LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;