Integrating Flyway with my Spring Boot Java application - unsupported Oracle version 12.2
MarkEHansen
Posts: 10 New member
I am trying to integrate Flyway community edition into my Spring Boot 3.1.0 application using Gradle to configure/build.
I have added the following in my dependencies section of the build.gradle file:
implementation group: 'org.flywaydb', name: 'flyway-core'
and refreshed the Gradle properties.
When I try to run the application, I get the following error:
...
Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Teams Edition or Oracle upgrade required: Oracle 12.2 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition.
The version of the database is 12.2.0.1.0, so I'm guessing this is the issue.
I've found the following Stack Overflow message: https://stackoverflow.com/questions/61951224/flyway-with-oracle/77332322#77332322
I've found the following Stack Overflow message: https://stackoverflow.com/questions/61951224/flyway-with-oracle/77332322#77332322
In which one responder says that with Flyway Community Edition 10.0.0, all Oracle database versions are now supported.
I think I'm using version 10.0.0. When I change the dependency entry in the build.gradle file to include the version 10.0.0, then I get a different error when trying to start the application:
Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: Oracle 12.2
Can I use Flyway Community Edition with Oracle 12.2?
Best Answer
-
Peter_Laws Posts: 272 Silver 2Please can you verify if the tablespace property is appropriately populated?
Answers
Your interpretation is correct. My anticipation is that you may have updated your flyway core version but your Oracle dependency may not be on v10 and that's where the change was introduced.
Regarding the version, what I was trying ot establish is, when you're altering the core version, are oyu also altering the dependancy?
E.G
dependencies {
implementation "org.flywaydb:flyway-database-oracle/10.0.1"
}
Happy to create a support issue for you to do so securely.
In what way did the dependency cause the refresh to fail please?
The other point is about the Oracle database driver. When I'm using Flyway 9.16.3, then I don't know what version of the flyway-database-oracle dependency to include. I tried 9.16.3 and it was not found. When I tried 10.0.0, I got errors during the Gradle refresh.
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.configureProperties(FlywayAutoConfiguration.java:254)
The following method did not exist:
'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)'
The calling method's class, org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration, was loaded from the following location:
jar:file:/C:/Users/Mark.Hansen/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/3.1.5/42a5b2ee98f700fba8d8c88d4af7b23266f1de0f/spring-boot-autoconfigure-3.1.5.jar!/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class
The called method's class, org.flywaydb.core.api.configuration.FluentConfiguration, is available from the following locations:
jar:file:/C:/Users/Mark.Hansen/.gradle/caches/modules-2/files-2.1/org.flywaydb/flyway-core/10.0.0/68984a8022f0daf4220a2e1605547684bea1e193/flyway-core-10.0.0.jar!/org/flywaydb/core/api/configuration/FluentConfiguration.class
The called method's class hierarchy was loaded from the following locations:
org.flywaydb.core.api.configuration.FluentConfiguration: file:/C:/Users/Mark.Hansen/.gradle/caches/modules-2/files-2.1/org.flywaydb/flyway-core/10.0.0/68984a8022f0daf4220a2e1605547684bea1e193/flyway-core-10.0.0.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration and org.flywaydb.core.api.configuration.FluentConfiguration
I believe it you update Spring to 3.1.6, the config issue should be resolved based off
https://github.com/spring-projects/spring-boot/issues/38164
&
https://github.com/spring-projects/spring-boot/issues/38267
But when I inspect that table, there are no records. I don't have any migrations yet, but when I run the application pointing at a later Oracle database version, the history table is created and the initial base migration record is created.
Error Code : 1950
Message : ORA-01950: no privileges on tablespace 'USERS'
2023-11-24T05:38:34,711-08:00 [main] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat]
2023-11-24T05:38:34,723-08:00 [main] INFO o.s.b.a.l.ConditionEvaluationReportLogger -
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-11-24T05:38:34,738-08:00 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unable to insert row for version '2.0' in Schema History table "XT"."FLYWAY_SCHEMA_HISTORY"
spring.flyway.locations=classpath:/db/migration
spring.flyway.defaultSchema=XT
spring.flyway.table=FLYWAY_SCHEMA_HISTORY
spring.flyway.baselineVersion=1
spring.flyway.baselineOnMigrate=true
spring.flyway.password=our admin user's password
As you can see, you're able to progress now with an older version, that's what the cited post referred to, that this functionality was now unblocked.
The statement "Oracle 12.2 is outside of Redgate community support. See https://rd.gt/468B6ni for details" means that issues might be unsupported for that db version. General flyway issues will of course continue to be worked on. Say for example there were historic bug in older flyway versions for this older db version, our allowing the functionality is 'as is' and not intending to broaden the support scope to avoid increasing development overhead. Were the issue also present in newer versions, it would be addressed.
As for your missing schema history table, it reads to me as though it's failing silently due to lack of tablespace to write to.
Is your admin user meant to be using the USERS tablespace and do they have a data allocation?
Given your comment on attempting a manual insertion with another tool, it seems as though the user doesn't have the needed rights.