1

Quarkus 1.12.2.Final

Getting the following exception while using reactive hibernate (quarkus-hibernate-reactive-panache) with reactive MySQL client (quarkus-reactive-mysql-client), kindly suggests what could be the issue.

2021-04-01 11:35:28,694 ERROR [org.hib.eng.jdb.spi.SqlExceptionHelper] (Quarkus Main Thread) Not using JDBC
2021-04-01 11:35:28,727 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.sql.SQLException: Not using JDBC
    at org.hibernate.reactive.provider.service.NoJdbcConnectionProvider.getConnection(NoJdbcConnectionProvider.java:25)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)

Some details

My application.properties

quarkus.datasource.jdbc=false
quarkus.datasource.db-kind=mysql
quarkus.datasource.username=root
quarkus.datasource.password=root
quarkus.datasource.reactive.url=mysql://localhost:3306/mydb
quarkus.datasource.reactive.max-size=20

My Repository Implementation

@ApplicationScoped public class EventRepository implements PanacheRepository<Event> {

}
Sabir Hussain
  • 175
  • 2
  • 9

6 Answers6

3

Change your application.properties to

quarkus.datasource.db-kind=mysql
quarkus.datasource.username=root
quarkus.datasource.password=root
quarkus.datasource.reactive.url=vertx-reactive:mysql://localhost:3306/mydb
quarkus.datasource.reactive.max-size=20
geoand
  • 60,071
  • 24
  • 172
  • 190
3

Here is the cause of the problem -> I used property "quarkus.hibernate-orm.database.generation=update". It seems like the use of this property requires JDBC connection, removed it, and it's working fine.

Any of the below config sets can work.

quarkus.datasource.db-kind=mysql
quarkus.datasource.username=****
quarkus.datasource.password=****
quarkus.datasource.reactive.url=mysql://localhost:3306/db
or 
quarkus.datasource.reactive.url=vertx-reactive:mysql://localhost:3306/db
Sabir Hussain
  • 175
  • 2
  • 9
2

"The latest version available of Hibernate Reactive doesn't support schema update and validation yet."

Relative issue here:

Weinan Li
  • 337
  • 2
  • 6
0

Can you try to add the following property to your settings?

quarkus.hibernate-orm.database.generation=update

You can write drop-and-create to re-create your db when you run your server as well. See details here.

0

Hmm. JDBC and Hibernate update should work in your case. Do you have a JDBC extension (dependency) in your project? If not, try to ad one.

In case of a postgres you can add extension this way:

./mvnw quarkus:add-extension -Dextensions="jdbc-postgresql

More info here

Add the agroal extension plus one of jdbc-db2, jdbc-derby, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle or jdbc-postgresql.

https://quarkus.io/guides/datasource

Marek Żylicz
  • 429
  • 3
  • 8
0

Add this dependency to your pom.xml file.

<!-- https://mvnrepository.com/artifact/io.quarkus/quarkus-jdbc-postgresql -->
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-jdbc-postgresql</artifactId>
    <version>2.9.2.Final</version>
</dependency>
stakahop
  • 921
  • 9
  • 18