0

Lately we updated our Liquibase version to 3.8.7

With the update, I encountered an issue regarding the DATABASECHANGELOGLOCK table. The table has all the same columns except for the LOCKED column which was changed from smallint to boolean.

Now this is causing an issue about the data types. See the log error below.

liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE "B515B1A3C_JPSOL21C"."DATABASECHANGELOGLOCK" SET "LOCKED" = 1, "LOCKEDBY" = 'vsa7421484s.ash.od.sap.biz (10.108.3.107)', "LOCKGRANTED" = '2020-04-08 08:32:29.759' WHERE "ID" = 1 AND "LOCKED" = 0: SAP DBTech JDBC: [266] (at 200): inconsistent datatype: INT type is not comparable with BOOLEAN type.: line 1 col 201 (at pos 200)

Full log:

2020 04 08 08:32:29#+00#ERROR#org.springframework.web.context.ContextLoader##anonymous#localhost-startStop-1#na#b515b1a3c#jpsol21c#web##na#na#na#na#Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in ServletContext resource [/WEB-INF/repository-context.xml]: Invocation of init method failed; nested exception is liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE "B515B1A3C_JPSOL21C"."DATABASECHANGELOGLOCK" SET "LOCKED" = 1, "LOCKEDBY" = 'vsa7421484s.ash.od.sap.biz (10.108.3.107)', "LOCKGRANTED" = '2020-04-08 08:32:29.759' WHERE "ID" = 1 AND "LOCKED" = 0: SAP DBTech JDBC: [266] (at 200): inconsistent datatype: INT type is not comparable with BOOLEAN type.: line 1 col 201 (at pos 200)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:836)
Caused by: liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE "B515B1A3C_JPSOL21C"."DATABASECHANGELOGLOCK" SET "LOCKED" = 1, "LOCKEDBY" = 'vsa7421484s.ash.od.sap.biz (10.108.3.107)', "LOCKGRANTED" = '2020-04-08 08:32:29.759' WHERE "ID" = 1 AND "LOCKED" = 0: SAP DBTech JDBC: [266] (at 200): inconsistent datatype: INT type is not comparable with BOOLEAN type.: line 1 col 201 (at pos 200)
at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:242)
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:170)
at liquibase.Liquibase.update(Liquibase.java:196)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1688)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1626)
... 25 common frames omitted
Caused by: liquibase.exception.DatabaseException: Error executing SQL UPDATE "B515B1A3C_JPSOL21C"."DATABASECHANGELOGLOCK" SET "LOCKED" = 1, "LOCKEDBY" = 'vsa7421484s.ash.od.sap.biz (10.108.3.107)', "LOCKGRANTED" = '2020-04-08 08:32:29.759' WHERE "ID" = 1 AND "LOCKED" = 0: SAP DBTech JDBC: [266] (at 200): inconsistent datatype: INT type is not comparable with BOOLEAN type.: line 1 col 201 (at pos 200)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:68)
at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:231)
at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:205)
at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:215)
... 35 common frames omitted

Already tried to drop the DATABASECHANGELOGLOCK table and its still not working. Any suggestions?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • look at this [answer](https://stackoverflow.com/questions/41801965/spring-liquibase-recover-when-application-is-crashed/41802213#41802213) – Essex Boy Apr 08 '20 at 09:02
  • not sure how this helps. The issue is that liquibase updates the locked column with an integer value but the column has a boolean data type. Although this should be okay right? Since boolean should also accept 0/1 as the input. Sorry but what exactly should I check in the link you mentioned? – Jose Paolo San Pedro Apr 08 '20 at 09:14
  • @JosePaoloSanPedro you mean that when you drop `databasechangeloglock` table, it gets recreated with `locked` column of `smallint` type and not `boolean`? – htshame Apr 08 '20 at 09:20
  • Hi @htshame, when I try to drop the `databasechangeloglock`, it recreates the table with the `locked` column having the `boolean` data type. But when I'm trying to start my application in `sap cloud platform` it fails with the error shown above. `INT type is not comparable with BOOLEAN type`. Liquibase tries to update the table using `0/1` as inputs for `locked` column – Jose Paolo San Pedro Apr 08 '20 at 09:31

0 Answers0