-
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
Add jdbc support for Oracle #1658
Comments
If you are satisfied with the JVM you can simply add the JDBC driver to your pom. In the meanwhile I cloned a fork of Quarkus that contains a draft of the JDBC Extension: https://github.com/Sanne/quarkus/tree/Oracle but still is unable to native compile. |
thank you @masini for your answer. It looks like you are working on this feature so if you need any help (even some alpha-testing) please let me know. |
Hi @masini @teriiehina . Any ideas if the native oracle extension now works ? |
I'm interested too for a oracle jdbc 'native' solution |
I'm interested too for Oracle native solution... |
Does someone have more info on this? |
Hi, sorry, I found a way to use Oracle in a native executable and forgot to share it here 😅 I have been using two natiive applications in production for one month 🎉 , using the followings settings. It is a complete solution for me so no problem if this issue is closed :) EDIT : added the configuration for the pom.xml
and
applications.properties
Dockerfile
reflection_config.json
|
Hi! Thank you for the explication @teriiehina; but I have an issue using quarkus 0.21.2 or 0.21.1 and graalvm 19.1.1 May I know which versions are you using? I will appreciate any hint. |
Hi @codecr, sorry for not giving the details. I'm indeed using the quarkus The solution is giving in the error log:
If you look at the hope it helps |
Hi @teriiehina , Actually my pom is identical to your suggestion but if try to switch to --initialize-at-build-time I got another set of errors. |
OK. sorry, I won't be of much help. |
@teriiehina I'm trying the same as you but getting a "ClassNotFoundException: oracle.jdbc.OracleTypes" even after registering it for reflection. I noticed you have the argument: This is pointing to a file that you did not provide... Could you please provide me with the contents of that file? Or even better provide all your project source code? Thanks |
@Nunalves you are right, I forgot to put the |
Just a heads-up that the Oracle JDBC drivers are in the central Maven repository: https://medium.com/@kuassimensah/oracle-jdbc-drivers-on-maven-central-64fcf724d8b |
I'd love to work on this issue by providing a new Quarkus extension. @gsmet are there any legal issues regarding the Oracle JDBC driver in the Maven repository and Quarkus? |
PR created in #4054 based on @Sanne's amazing job in Sanne@29025e7 and @teriiehina's comment in #1658 (comment). I'd appreciate if someone could give it a try:) |
First of all, great work @gastaldi ! 👍 |
Hello People, is there any official support in quarkus native build of Oracle JDBC? |
Surprisingly that there's still no official support for Oracle JDBC. I really want to try out Quarkus in production but this issue is preventing me from doing this. |
@duclm2609 you can simply add the Oracle JDBC driver in your pom.xml and it should work fine (unless you compile to native). |
Well, not at all, you cannot create a native image with Oracle JDBC.
Il giorno ven 10 apr 2020 alle ore 13:49 George Gastaldi <
[email protected]> ha scritto:
… @duclm2609 <https://github.com/duclm2609> you can simply add the Oracle
JDBC driver in your pom.xml and it should work fine (unless you compile to
native).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1658 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPXERTMCLKNVQCQUWHD3LTRL4BT5ANCNFSM4HAU5FTQ>
.
--
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
|
That's what I meant with the |
Ops, I need an holiday from quarantine
Il giorno ven 10 apr 2020 alle ore 15:57 George Gastaldi <
[email protected]> ha scritto:
… Well, not at all, you cannot create a native image with Oracle JDBC.
That's what I meant with the (unless you compile to native) 😉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1658 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPXERWS34LYD7KETTE2CV3RL4QS3ANCNFSM4HAU5FTQ>
.
--
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
|
Hello everyone, For those who need to use Oracle and would like a native image, I got my Quarkus application working out of the box as a native image with Oracle using the Helidon Oracle JDBC drivers. It's a "JDBC driver for Oracle database with native-image support". Didn't need any extra native-image build args nor any reflect-config.json. It's open source and distributed under Apache 2.0 license. I just added the following in my pom.xml (no direct dependency to Oracle jdbc):
It uses the ojdbc10 version 19.3.0.0 behind. If there are no technical issues or problem with licensing, maybe we could have a Quarkus Oracle extension using those driver instead (at least while waiting for the Oracle drivers release)? Or figure out how they got it working with native-image support? |
IMHO we may still run into licensing issues since the Oracle's JDBC driver is resolved transitively. @Sanne? |
Yes, possibly. I don't have deep knowledge about licenses, that's why I mentioned it :). I just suggested it in case it might help.
It might help those who would want to use Quarkus but need a native image and are stuck with an Oracle DB. Unless of course those drivers pose any licensing issues themselves. |
I don't think it would be a problem to depend on an helidon component (or anything else that is in Maven Central for that matter), but considering the next Oracle JDBC driver is going to be released soon - and is expected to feature GraalVM native-image support - I think I'd rather wait another couple of weeks. |
Sure, fair enough :). I guess the solution with Helidon drivers and |
@loicmarchal this is very nice as a workaround. Please be aware afaics this dependency has a compile dependency on https://mvnrepository.com/artifact/com.oracle.ojdbc/ojdbc10/19.3.0.0. Thus I'm surprised Helidon is able to ship this under ASL2 if they are literally reshading the oracle driver jar. IANAL, but just be aware that you are most likey shipping bits that are under Oracle Free Use Terms and Conditions and not just ASL2. |
Thanks @maxandersen, that's a good point! I was also unsure about the ASL2 since it's shipped with Oracle drivers, but again I really don't know much about all the legal aspects of licenses. Better to have it in mind though. Also, I checked the jar that comes with the https://mvnrepository.com/artifact/io.helidon.integrations.db/ojdbc/2.1.0 dependency and there is only a transitive dependency to the Oracle ojdbc10 (19.3.0.0) and some config files. So I removed the dependency to Helidon JDBC drivers and used the official Oracle JDBC drivers with the same config as in the Helidon jar and my Quarkus native-image works just fine (compiled with the mvn package -Pnative). So that's another option if one wants to only have dependencies to the official Oracle drivers. Helidon guys did a great job figuring out how to configure the native-image compiler to work with Oracle drivers I must say :) |
yes. You'll notice we've done similar for those with non-propritary licenses :) As Sanne said we've worked with oracle to make the next release of oracle jdbc drivers native friendly. |
You guys did an amazing job :) I was initially compiling to native images manually, but had to write the bash scripts, the Dockerfiles and sometimes had to run the native-image-agent to fix the config for the reflection. It's nice having it out of the box using Quarkus (and even the performances on the JVM are great, although I still wanted a native-image). I first used Postgres for my own project, so indeed you guys did a great job integrating those non-proprietary :) The organization I'm helping now is using Oracle in production so I had to find a solution (that's how I found the workaround I shared on this thread). It's great you guys worked with Oracle to get it native friendly, thanks 👍 I'll change my workaround to a native Quarkus extension as soon as it's available ;) |
they are not - I misread their setup. Its a wrapper jar; still triggers oracle license in use though. |
I would also add that using an unsupported driver is a way to allow "Oracle
Support" to tell you "You configuration is not in matrix" in case of
problems.
Il giorno dom 25 ott 2020 alle ore 07:19 Max Rydahl Andersen <
[email protected]> ha scritto:
… are literally reshading the oracle driver jar.
they are not - I misread their setup. Its a wrapper jar; still triggers
oracle license in use though.
Thus just something to be aware off.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1658 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPXERUQ4YXZKP4AGFU2XE3SMO7O7ANCNFSM4HAU5FTQ>
.
--
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
|
In fact, the Helidon dependency doesn't pull any custom or modified driver. It's literally just the official Oracle JDBC driver (19.3.0.0) wrapped with a config file helping the native-image initialize the right classes at build/run time. That's why, as I mentioned in my comment here, you can use the Oracle driver directly. That's what I've done in my project and it works fine. I have
and the right I'm using Kotlin, Hibernate and Panache. It compiles and runs perfectly in Docker. IMHO it's an acceptable solution for those who have to use Oracle in production now, while waiting for the release of the next Oracle JDBC driver (hopefully with support for native-image OOB) and the Quarkus extension. |
I just saw on Maven-Central that the new JDBC drivers from Oracle have been released in version 21 with GraalVM support (see here) yesterday. This seems to be the "regular", blocking JDBC driver, but as stated here, there should be a reactive version as well. However, I tried to use them directly in a Quarkus v1.10.5 application without any modification like providing a
|
Unfortunately it seems the Oracle driver is including explicit GraalVM directives, but these are not compatible with other flags that other frameworks require. You can check the parameters they impose by looking into the resources in In particular I noticed these as being problematic:
We will need :
|
Both the Oracle Database team and the GraalVM team have been very helpful; it's not as polished as I'd hoped for but this works: To be more polished IMO it should not rely on the above flags ^, but the specific order of the directives we generate seem effective enough to override the most critical ones. In parallel the Oracle JDBC team has suggested they will likely revisit the flags the jar is embedding, but that will have to wait for their next significant release. The other flag that still concerns me is the |
I have been struggle with this problem, I have a service with Quarkus, Apache Camel and Jdbc Oracle when I try run in native mode receive |
@DouglasGo8 you may want to report on https://github.com/apache/camel-quarkus/issues/new including proper steps to reproduce. |
yes please report to Camel. @ppalaga let me know if you need help.. this was tricky. It's probably related to some other component which is triggering a chain initialization at static init time; you'd either have to change the code to avoid this, or have such other component also reconfigured for runtime initialization, as I won't be able to change the Oracle driver code. |
Reported at apache/camel-quarkus#2448 |
Hi,
it would really help advocate for Quarkus in my company if it was possible to use it with an Oracle database.
I didn't find any information on how to add support for a new jdbc driver and I'm pretty noob on this. I quickly had a look at the jdbc extensions but I didn't find a common pattern.
If somebody could give me a hint or two on how to add support for the Oracle driver, I will be happy to contribute :)
The text was updated successfully, but these errors were encountered: