Hi, When I upgrade from Springboot2.3.8 to 2.4.5, Liquibase execution becomes slower and slower. It used to be only 20s, now it needs 300s.
Comment From: wilkinsona
Spring Boot isn't really involved with Liquibase's execution. It configures it with a DataSource
to use and some changelogs and then Liquibase does the rest. Spring Boot 2.3.x uses Liquibase 3.8.x and Spring Boot 2.4.x uses Liquibase 3.10.x so I suspect that the problem you're seeing is due to a change in Liquibase. It may also be a problem with the JDBC connection pool and driver that you're using, but I would expect any change there to be apparent in all JDBC queries and not just when using Liquibase.
I would recommend trying Liquibase 3.8.x with Spring Boot 2.4.x to see if it speeds things back up. If it does, it's a Liquibase problem. If it doesn't, I'd recommend doing the same with the versions of the connection pool and JDBC driver that you're using.
If none of this helps and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: wurangbo
I have tried but failed. springboot 2.4.5 mysql collection 8.0.23 liquibase : 3.10.2 It runs fine the first time(ceate tables), but very slow. when I run for the second time, get exception as bellow:
Caused by: java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.lang.String
at liquibase.changelog.StandardChangeLogHistoryService.getRanChangeSets(StandardChangeLogHistoryService.java:328)
at liquibase.changelog.AbstractChangeLogHistoryService.upgradeChecksums(AbstractChangeLogHistoryService.java:66)
at liquibase.changelog.StandardChangeLogHistoryService.upgradeChecksums(StandardChangeLogHistoryService.java:297)
at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:1174)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:178)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
I want to know which version of liquibase and mysql-collector is compatible with springboot 2.4.X
Comment From: wurangbo
hi, there is a simple example, when I upgrade to 2.4.5, I got the same error . https://github.com/kishorereddi/Springboot-liquibase-mysql
Comment From: wilkinsona
To use Liquibase 3.10.x with MySQL you’ll need to downgrade to MySQL 8.0.22. Alternatively you can upgrade to Liquibase 4.x.