Oracle 19 的休眠方言

人气:267 发布:2022-10-16 标签: java oracle hibernate spring-data-jpa oracle19c

问题描述

我们的一个数据库升级到 Oracle 19c,现在我的应用程序无法连接到数据库

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

我收到以下错误.

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'

我搜索了 oracle 19 的方言,但找不到任何方言.

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

是否有适用于 oracle 19 的方言?

Is there is a dialect available for oracle 19 ?

推荐答案

没有比 12c 更新的方言了,可以将它与 19c 一起使用,但是 hibernate-orm 中存在一个错误,它阻止了自动检测工作,见:

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

在较新的 5.4 版本中已经解决了,我为 5.3 分支打开了 PR.

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

目前的解决方法是手动将方言属性 hibernate.dialect 设置为 org.hibernate.dialect.Oracle12cDialect.

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

670