-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quarkus.datasource.db-version does not work with persistence.xml
#43216
Comments
Tried to reproduce in just quarkus against 3.14.2 and the property worked as expected, so this is actually a keycloak issue. |
@mabartos @vmuzikar this issue is being caused by having the default-persistence.xml - we hit Line 1209 in 155093d
Line 1192 in 155093d
@yrodiere is there a workaround for this? Are values in the default-persistence.xml interpolated against the smallrye configuration such that we could add the mapping from quarkus.datasource.db-version to the jakarta property ourselves? - I believe the concensus from keycloak/keycloak#25384 was that env property references were not supported. We also still have an active issue (keycloak/keycloak#27320) on moving away from using persistence.xml both internally and for customizations. |
That's indeed a problem. From the docs:
They are not.
Looking at the code, you can try to set the H2 version through configuration property If you cannot hardcode it -- but for your investigation, surely you can? -- you can try setting it as a system property... Hibernate ORM might possibly pick it up, though I'm not certain. IMPORTANT: This is only something you should do in the context of investigations. Overriding the version of H2 in Quarkus is completely untested and unsupported, because part of the H2 integration in Quarkus is tied to its internal code (in particular for native image). Changing the version of H2 may result in various unpredictable failures.
That would indeed spare you a lot of trouble. Beside these limitations, there are very few tests in Quarkus involving |
I'd still argue that |
Okay, I'll update the docs. It should also state that Quarkus will not attempt to configure Hibernate ORM for you based on your environment, you need to put it all in I suppose we could create an enhancement request (feel free to do so!) to make Quarkus configure datasource-related properties in Hibernate ORM, even when using
|
persistence.xml
Done here: #43240 I also tested that setting |
Thanks for the follow up @yrodiere It looks like we won't need to use the workaround as h2 version 2.3.230 does not seem to exhibit the same problem. |
@shawkins do you think we should downgrade H2 for 3.15.0? |
Probably. I'll open an upstream issue in H2. They should be able to confirm what is happening with 2.3.232. |
Describe the bug
Attempting to override the h2 version after the upgrade to Quarkus 3.14.2 results in an error mentioning that quarkus.datasource.db-version can be used. However when that is set, the error remains.
Expected behavior
quarkus.datasource.db-version should be honored.
Actual behavior
quarkus.datasource.db-version is not honored. I can see that the appropriate build time value is captured, but the check is always performed against
quarkus/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/QuarkusRuntimeInitDialectFactoryInitiator.java
Line 28 in e1577e6
How to Reproduce?
Try to downgrade h2 on quarkus 3.14.2 to a 2.2.x release.
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.14.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: