0

The database group recently upgraded the database to Oracle12c. I am currently using Hibernate 4.3.9. When I try to deploy the application, WebLogic throws an exception:

weblogic.application.ModuleException: org.hibernate.HibernateException: Unable to determine dialect to use [name=Oracle, majorVersion=12]; user must register resolver or explicitly set 'hibernate.dialect'.

HibernateUtil has

props.setProperty("hibernate.dialect", "utilities.OracleDialectExtended");

Where OracleDialectExtended extends Oracle10gDialect in order to register a Double as a float. HibernateUtil is being used to set the properties rather than in hibernate.cfg.xml.

Everything I have read indicates that using Oracle10gDialect should be OK. In fact, when I use the same set up in a batch type mode (not using WebLogic) I am able to connect with and work with Oracle without a problem.

Does anyone know how to resolve this? Or is this a WebLogic problem that needs to be addressed by a WebLogic admin.

Thanks.

BigFish
  • 129
  • 6
  • 19

2 Answers2

0

Try with this:

props.setProperty("hibernate.dialect","org.hibernate.dialect.OracleDialect");
Rohit Gaikwad
  • 3,677
  • 3
  • 17
  • 40
  • org.hibernate.dialect.OracleDialect is deprecated and the recommended replacement is Oracle8iDialect, which is in the inheritance tree for Oracle10gDialect. The 12c dialect isn't in the same inheritance tree as OracleDialect until you get to Dialect. But both OracleDialect and Oracle10gDialect are subclasses of Dialect. So what I'm missing about this is if I'm only using the features available to a specific class, why does WebLogic care which one is being used. – BigFish Oct 04 '16 at 11:40
  • http://stackoverflow.com/questions/31698651/hibernate-dialect-for-oracle-12c?rq=1 – BigFish Oct 04 '16 at 11:45
  • I think the WebLogic has nothing to do with this issue, the issue is related to hibernate context configuration. i.e, related to hibernate. check the exception, its hibernate exception. Even org.hibernate.dialect.OracleDialect is deprecated does it worked for you? – Rohit Gaikwad Oct 04 '16 at 11:48
  • No, it didn't. Same error as the one in the original post. – BigFish Oct 04 '16 at 12:52
0

Just to follow up - in the end I upgraded Hibernate from 4.3.9 to 5.1.2 and things started working again.

Not the most ideal solution since a database upgrade shouldn't break an application but it was the fastest way to get things up and running again.

BigFish
  • 129
  • 6
  • 19