quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.64k stars 2.64k forks source link

Oracle: TNS URL Format is not supported when connecting to Autonomous DB #41708

Closed rbaumgar closed 2 months ago

rbaumgar commented 3 months ago

Describe the bug

Try to connect to an Oracle Autonomous DB with the quarkus-reactive-oracle-client.

vertx-reactive:oracle:thin:@(description=(address=(protocol=tcps)(port=1521)(host=adb.somewhere.oraclecloud.com))(connect_data=(service_name=abcdef_demodb_tpurgent.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))

Caused by: io.vertx.core.VertxException: TNS URL Format is not supported

Works fine with "normal" DBs. connection_string=myhost:1521/mydb quarkus.datasource.db-kind=oracle quarkus.datasource.username=${user} quarkus.datasource.password=${password}

Work around: create a file in /tnsnames/tnsnames.ora with atp_tp=(description=... and set the connection to atp_tp?TNS_ADMIN=/tnsnames/

Documentation at https://quarkus.io/guides/datasource#jdbc-url points to https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/data-sources-and-URLs.html#GUID-8D0ADAE6-B8EF-4E02-85E3-15C2509ACBD8

Which means "(description..." should work fine.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

17

Quarkus version or git rev

3.11

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 3 months ago

/cc @tsegismont (reactive-sql-clients), @vietj (reactive-sql-clients)

cescoffier commented 2 months ago

@tsegismont, that's something that needs to be added to the Oracle reactive client, right?

tsegismont commented 2 months ago

The supported connection methods are EZformat URL and TNS alias (see https://vertx.io/docs/vertx-oracle-client/java/#_connection_uri)

@rbaumgar if you need it please file an issue upstream

I can assist you in providing a PR, would you be interested?

rbaumgar commented 2 months ago

@tsegismont it is already solved in vertx-sql-client, https://github.com/eclipse-vertx/vertx-sql-client/issues/1156

tsegismont commented 2 months ago

@rbaumgar This is the issue tracking TNS Alias connection format (the workaround you described)

cescoffier commented 2 months ago

So, if I understand correctly it's not something currently supported by the Vertx client. Please open an issue in the upstream project.

rbaumgar commented 2 months ago

If this is true then we should update the documentation at https://quarkus.io/guides/datasource#jdbc-url with the link to Oracle documentation.

tsegismont commented 2 months ago

The doc for Reactive Oracle client URL is correct: https://quarkus.io/guides/datasource#oracle-2

rbaumgar commented 2 months ago

@tsegismont, I see now where the misunderstanding is coming from. I was looking at the JDBC reference and not the reactive reference.