Comments (11)
/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive), @gsmet (hibernate-orm), @mswatosh (db2), @yrodiere (hibernate-orm)
from quarkus.
I will give it a look
from quarkus.
I don't know why, but Hibernate ORM reads the wrong database version when picking the dialect.
@tmulle, as a workaround, you can set the following property in the application.properties
:
quarkus.datasource.db-version=10.11
@yrodiere, any idea?
from quarkus.
@DavideD thanks that workaround does work. I will leave that in-place until an official fix is ready.
from quarkus.
I don't know why, but Hibernate ORM reads the wrong database version when picking the dialect.
What do you mean, "reads the wrong database version"? There is nothing to read, the dialect is picked offline, at build time.
Generally when db-version
is not set, we pick Hibernate ORM's earliest supported version; in the case of MariaDB, it's 10.4, though for history reasons, Quarkus will default to 10.6 instead.
@tmulle, as a workaround, you can set the following property in the
application.properties
:quarkus.datasource.db-version=10.11
This is not a workaround, this is the proper solution to this problem.
See https://quarkus.io/guides/hibernate-orm#hibernate-dialect-supported-databases:
By default, the dialect is configured to target the minimum supported version of the database.
In order for Hibernate ORM to generate more efficient SQL,
to avoid workarounds and to take advantage of more database features,
you can set the database version explicitly:quarkus.datasource.db-kind = postgresql quarkus.datasource.db-version = 14.0 quarkus.datasource.username = hibernate quarkus.datasource.password = hibernate quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/hibernate_db
As a rule, the version set here should be as high as possible,
but must be lower than or equal to the version of any database your application will connect to.
Closing this issue, as this is not a bug: you really should configure your DB version if you expect features beyond what the oldest supported version of your database can offer.
from quarkus.
What do you mean, "reads the wrong database version"? There is nothing to read, the dialect is picked offline, at build time.
Ok, I get it and I didn't read the whole documentation, so I didn't know this was the expected behaviour.
But it's different than what happens with regular Hibernate ORM. So, unless somebody has read the documentation in detail, there's nothing that indicates that this is the correct behaviour. Not to mention that somebody might decide to switch database and not realizing that the new one is not supported.
It would be nice to have a message at start up containing the selected dialect with the version and a note that it's not supported so the default version will be used instead.
from quarkus.
It would be nice to have a message at start up containing the selected dialect with the version and a note that it's not supported so the default version will be used instead.
I guess I'm not the only one that thinks this is important info to have: #40922
from quarkus.
It would be nice to have a message at start up containing the selected dialect with the version and a note that it's not supported so the default version will be used instead.
The default version is used for supported dialects too.
from quarkus.
This is not what the documentation says, though:
For supported databases, the Hibernate ORM dialect does not need to be set explicitly: it is selected automatically based on the datasource.
from quarkus.
Ok... I guess the dialect is selected but the correct version isn't?
Am I the only one that thinks a bit more clarity would be nice?
from quarkus.
Ok... I guess the dialect is selected but the correct version isn't?
Yes.
Am I the only one that thinks a bit more clarity would be nice?
You're the first to report this particular problem, yes.
Feel free to send a PR if you have an idea how to improve the wording.
from quarkus.
Related Issues (20)
- Qute: StackOverflowError due to nested #include and #insert directives HOT 2
- Quarkus OIDC makes first request very slow HOT 10
- Adds hibernate-vector extension to not directly depend on Hibernate version HOT 4
- PanacheQuery: singleResultOptional() gives hibernate warning "HHH000104" HOT 2
- Missing jar artifact when downloading dependencies for offline development HOT 1
- Quarkus Scheduler, when calling a token-protected endpoint (keycloak) fails to refresh the token HOT 5
- Error Due to Duplicate Event Listener in Hibernate SessionFactory Initialization when start application HOT 2
- 3.12.0 does not allow cross building with Jib HOT 6
- Arc: declare a synthetic, runtime-initialized bean as eagerly initialized (if conditions met) HOT 7
- Split package in "io.fabric8.kubernetes.api.model" since Quarkus 3.12.0 HOT 8
- [Extension Proposal] JMX Beans HOT 2
- Quarkus welcome page is different when rendered vai CLI on linux vs windows HOT 1
- UserAgent header is not set after service is running HOT 7
- quarkus-container-image-docker 3.8.5 doesnt see docker allias
- Building native executable fails. HOT 1
- Exception handling with @ServerExceptionMapper does not match method with more general exception HOT 4
- Mismatch between registry data and platform json bom for some extensions HOT 1
- Quarkus Kubernetes Extension has no startup-probe for sidecars HOT 2
- Quarkus 3.6.7 runs all concurrent http request in the same vert.x-event-loop-thread HOT 5
- Dev UI clash with any other WebJarUtilBuildItem when in the same artifact HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus.