Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate Dialect for Oracle 19

One of our database was upgraded to Oracle 19c and now my application is unable to connect to database

I am getting the following error.

HHH000400: Using dialect: org.hibernate.dialect.Oracle12cDialect
HHH000342: Could not obtain connection to query metadata : Unable to determine Dialect to use [name=Oracle, majorVersion=19]; user must register resolver or explicitly set 'hibernate.dialect'

I searched for dialect for oracle 19 but could't find any .

Is there is a dialect available for oracle 19 ?

like image 232
NullPointerException Avatar asked Aug 29 '19 17:08

NullPointerException


People also ask

What is hibernate dialect for Oracle?

Dialect allows Hibernate to generate SQL optimized for a particular relational database. Hibernate generates queries for the specific database based on the Dialect class. A hibernate dialect gives information to the framework of how to convert hibernate queries(HQL) into native SQL queries.

Does Oracle 19c require Java?

In summary: If you want to use Oracle 19c with Oracle supported drivers, upgrading to Java 8 LTS or later is the only feasible solution.


1 Answers

There isn't a newer dialect than 12c, and it would be fine to use it with 19c, but there was a bug in hibernate-orm that prevents the auto detection to work, see:

https://hibernate.atlassian.net/browse/HHH-13184

https://hibernate.atlassian.net/browse/HHH-13609

It is already solved in the newer 5.4 releases, and I opened a PR for the 5.3 branch.

A workaround for now is to manually set the dialect property hibernate.dialect to org.hibernate.dialect.Oracle12cDialect.

like image 51
Joel Arnold Avatar answered Sep 19 '22 13:09

Joel Arnold