Bug 975374 - Automatic Hibernate dialect detection does not work with PostgresPlus 9.2
Automatic Hibernate dialect detection does not work with PostgresPlus 9.2
Status: CLOSED WONTFIX
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ER03
: 6.1.0
Assigned To: Viliam Rockai
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-18 05:48 EDT by Dominik Pospisil
Modified: 2015-08-31 23:31 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
An issue with Hibernate caused the PostgresPlus 9.2 database to not be detected automatically. To work around the issue, specify the PostgresPlus dialect in the 'JPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/organization/idm-configuration.xml' file to ensure the portal runs correctly. [source,XML] ---- <property name="hibernate.dialect" value="org.hibernate.dialect.PostgresPlusDialect"/> ----
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-09 05:08:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GTNPORTAL-2960 Major Resolved Unable to determine Dialect to use [name=EnterpriseDB, majorVersion=9] - for PostgresPlus 9.2 2015-11-12 03:40 EST

  None (edit)
Description Dominik Pospisil 2013-06-18 05:48:44 EDT
Hibernate DialectFactory cannot determine "hibernate.dialect" for PostgresPlus 9.2 (EnterpriseDB).
... 
org.hibernate.HibernateException: Unable to determine Dialect to use [name=EnterpriseDB, majorVersion=9]; user must register resolver or explicitly set 'hibernate.dialect'
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:105) [hibernate-core-4.1.6.Final.jar:4.1.6.Final]
at 
...

As a workaroud, IDM datasource dialect may be set manually to "org.hibernate.dialect.PostgresPlusDialect".
Comment 1 Boleslaw Dawidowicz 2013-06-18 06:03:38 EDT
We'll need to check if this can be fixed by Hibernate upgrade (Vlasta tried with 4.2.1 already). If there is no easy fix it should be documented as a known issue with workaround to set the dialect manually.
Comment 3 Viliam Rockai 2013-07-03 10:32:42 EDT
I've tried to run the JPP ER02 with the configuration used in the QA:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EPP/view/EPP/view/6.1/view/UI%20Database%20Support/job/epp6_ui_selenium_tests_db_postgresplus92/

The exception described above wasn't raised even if I changed the configuration to:
gatein.jcr.datasource.dialect=auto

Instead of this problem, there is a new one and is related to the jdbc driver:
https://bugzilla.redhat.com/show_bug.cgi?id=979528

Switching the hibernate version to 4.2.2 didn't affect this bug in any way.

By switching I mean replacing these libs in modules:
./modules/system/layers/base/org/hibernate/main/hibernate-entitymanager-4.2.0.Final-redhat-1.jar
./modules/system/layers/base/org/hibernate/main/hibernate-core-4.2.0.Final-redhat-1.jar
./modules/system/layers/base/org/hibernate/main/hibernate-infinispan-4.2.0.Final-redhat-1.jar
./modules/system/layers/base/org/hibernate/envers/main/hibernate-envers-4.2.0.Final-redhat-1.jar
Comment 4 Viliam Rockai 2013-07-03 11:25:12 EDT
I was using the "edb-jdbc14.jar" driver.
Comment 5 Tomas Kyjovsky 2013-07-04 13:40:07 EDT
I still reproduced this issue with ER2 (and also with the latest gatein-master). I still get the "Unable to determine Dialect to use [name=EnterpriseDB, majorVersion=9]" exception if I don't set the dialect for JCR datasource explicitly.
Comment 6 Martin Simka 2013-07-08 08:14:21 EDT
FYI: https://hibernate.atlassian.net/browse/HHH-8349
Comment 7 Viliam Rockai 2013-07-08 10:07:04 EDT
I've inspected this bug again and configured it to pg+ from scratch. I was able to reproduce the issue and I'm getting the same error as tkyjovsky.

After specifying the dialect in:
gatein/gatein.ear/portal.war/WEB-INF/conf/organization/idm-configuration.xml
by adding
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgresPlusDialect"/>

I'm not getting the dialect error anymore, and I have this one instead:
https://bugzilla.redhat.com/show_bug.cgi?id=979528


Switching the hibernate version to 4.2.2 didn't affect this bug in any way.
Comment 8 JBoss JIRA Server 2014-01-06 15:10:58 EST
Tomas Kyjovsky <tkyjovsk@redhat.com> updated the status of jira GTNPORTAL-2960 to Resolved

Note You need to log in before you can comment on or make changes to this bug.