Hi
We hit an issue migrating from spring-boot 3.4.0 to 3.4.1 and think it's related to the change around how datasources are initialised and the h2 console.
We use flyway for DB migrations and h2 in mem mode.
With 3.4.1, migrations are successfully applied, then when @Sql scripts are run we get an error:
org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "STANDARD_CONDITION" not found (this database is empty); SQL statement:
DELETE from standard_condition [42104-232]
I suspect its due to two different in memory databases being created. If I change the db connection string to use the filesystem then all the tests pass.
I think it's related to the console fix as with spring-boot 3.4.0, the tests pass with the console enabled:
spring:
h2:
console:
enabled: true
But they fail with the same error when the console is disabled.
Comment From: wilkinsona
Please provide a minimal sample that works with 3.4.0 and fails when upgraded to 3.4.1.
Comment From: andrewrlee
Sorry, didn't have time to create a reproducible example.
I'm not sure what the issue is but managed to work around it by adding ;DB_CLOSE_DELAY=-1
Comment From: andrewrlee
(I think previously the H2's triggering of the early initialisation of the datasource meant that the same DB instance was used as there'd be live connections in the connection pool hanging around)