hibernate-reactive
hibernate-reactive copied to clipboard
oracle connect error.
Hello..
i use Oracle Autonomous Data Warehouse.
jdbc url example : jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=server_name)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=serviceName)))
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/connect-jdbc-thin-tls.html#GUID-364DB7F0-6F4F-4C42-9395-4BA4D09F0483
but connection error.
error message here
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: begin 0, end -1, length 235
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:277) ~[hibernate-core-6.2.2.Final.jar:6.2.2.Final]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Are you sure this is an issue for Hibernate Reactive? Which dependencies are in your project?
I tested example source
Hibernate Reactive doesn't use the JDBC driver.
You should check if you can do what you need with the Vert.x Oracle Client
org.hibernate.reactive.pool.impl.DefaultSqlClientPoolConfiguration
oraclePath method return empty string oracleHost method throw exception
plese check this method..
build. gradle
dependencies {
implementation project(':hibernate-reactive-core')
// Hibernate Validator (optional)
implementation 'org.hibernate.validator:hibernate-validator:7.0.2.Final'
runtimeOnly 'org.glassfish:jakarta.el:3.0.3'
// JPA metamodel generation for criteria queries (optional)
annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernateOrmVersion}"
// database drivers for PostgreSQL and MySQL
// runtimeOnly "io.vertx:vertx-pg-client:${vertxVersion}"
// runtimeOnly "io.vertx:vertx-mysql-client:${vertxVersion}"
runtimeOnly "io.vertx:vertx-oracle-client:${vertxVersion}"
// logging (optional)
runtimeOnly "org.apache.logging.log4j:log4j-core:2.20.0"
// Allow authentication to PostgreSQL using SCRAM:
runtimeOnly 'com.ongres.scram:client:2.1'
}
persistence.xml
<class>org.hibernate.reactive.example.session.Author</class>
<class>org.hibernate.reactive.example.session.Book</class>
<properties>
<!-- MySQL -->
<property name="jakarta.persistence.jdbc.url"
value="jdbc:oracle:thin:@(DESCRIPTION=(RETRY_COUNT=20)(RETRY_DELAY=3)(ADDRESS=(PROTOCOL=TCPS)(PORT=1521)(HOST=ADB.AP-CHUNCHEON-1.ORACLECLOUD.COM))(CONNECT_DATA=(SERVICE_NAME=****************))(SECURITY=(SSL_SERVER_DN_MATCH=YES)))"/>
<!-- Credentials -->
<property name="jakarta.persistence.jdbc.user"
value="*******"/>
<property name="jakarta.persistence.jdbc.password"
value="*******"/>
<!-- The Vert.x SQL Client connection pool size -->
<property name="hibernate.connection.pool_size"
value="10"/>
<!-- Automatic schema export -->
<property name="jakarta.persistence.schema-generation.database.action"
value="drop-and-create"/>
<!-- SQL statement logging -->
<property name="hibernate.format_sql" value="true"/>
<!--property name="hibernate.show_sql" value="true"/-->
</properties>
</persistence-unit>
It seems that the oracle driver supports this type of syntax. I will have a look as soon as I have some time. In the meanwhile, you can try this approach I've suggested some time ago on StackOverflow