Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
Hello.
Yes, and that change is even documented:
That may be the case, but the MariaDB extension in Quarkus is not at all intended to be used against MySQL. In particular, since you are using Hibernate ORM: with this setup, by default Hibernate ORM will assume it's working on MariaDB and will generate SQL that works on MariaDB... but may not work on MySQL. Similarly, Hibernate ORM will work with SQL types that are a good fit for MariaDB, but may not even exist on MySQL.
I'd suggest switching to MariaDB, but I suspect that's less than helpful 😁 Right now I don't think there is any good way, because this is simply not a feature that Quarkus provides. You may want to open a feature request (and ideally, after discussing the solution, a pull request). But if your goal is just to escape some pinning (which is likely being solved in EA versions of Loom on OpenJDK 24), I doubt that's worth a new feature. So, workarounds. You could try this:
It's ugly, and you'll most likely end up with warnings, but it might just work. Quarkus should pass version No guarantee it will continue to work forever, of course: you did paint yourself into a corner :) EDIT:
I tend to disagree, as there's a limit to the amount of combinations we can reasonably support. |
Beta Was this translation helpful? Give feedback.
-
Thanks @yrodiere . The loom fixes cant come soon enough :-) My sense is that for now using quarkus.datasource.db-version=8.0.0 should be fine then. We don't use hibernate to generate complex queries and joins. We specifically don't use foreign keys in entity mappings and we do joins with native queries. Data types are also all pretty basic. When loom fixes the pinning we can move back to MySQL driver and can repaint the room in the opposite direction ;-) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We use virtual threads and MySQL 8+ database. Due to the MySQL driver still having pinning issues with synchronized blocks, we changed to use the MariaDB driver which plays nice with virtual threads. We thus ended up with:
All works great and the world is a happy place. Virtual threads happily do DB work with no pinning
Now we upgraded from 3.11.1 to 3.12.0.CR1 and get an error:
Caused by: io.quarkus.runtime.configuration.ConfigurationException: Persistence unit '' was configured to run with a database version of at least '10.6.0', but the actual version is '8.0.0'. Consider upgrading your database. Alternatively, rebuild your application with 'quarkus.datasource.db-version=8.0.0' (but this may disable some features and/or impact performance negatively).
Its clear that there is a change to check that you are not using a very old DB. BUT... MySQL 8 is not old but MariaDB 8 is very old... We seem to have painted ourselves into a corner by assuming that Quarkus would play nice with using MariaDB driver but MySQL DB. Officially MariaDB driver is intended to be used against both MariaDB and MySQL:
If we try and use MariaDB driver and MySQL as the db-kind like this:
Then we get error: Unable to find a JDBC driver corresponding to the database kind 'mysql' for the default datasource (available: 'mariadb'). Check if it's a typo, otherwise provide a suitable JDBC driver extension, define the driver manually, or disable the JDBC datasource by adding 'quarkus.datasource.jdbc=false' to your configuration if you don't need it.
So the discussion is... what would be a good way of using MariaDB driver with MySQL? If we set quarkus.datasource.db-version=8.0.0 then will this really "disable some features and/or impact performance negatively". I'd be uncomfortable going that route if it does. I kind of think that Quarkus should allow the driver to be independent from the database kind or at least mark that db-kind=mysql should happily use MariaDB as the driver?
Beta Was this translation helpful? Give feedback.
All reactions