-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: HibernateException: unknown Oracle major version [0]
PostPosted: Mon Jan 14, 2008 2:22 pm 
Newbie

Joined: Fri Nov 14, 2003 8:37 am
Posts: 14
Location: Hamburg - Germany
Hibernate version:3.2.5.ga

Full stack trace of any exception that occurs:
Caused by: org.hibernate.HibernateException: unknown Oracle major version [0]
at org.hibernate.dialect.DialectFactory$1.getDialectClass(DialectFactory.java:135)
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:65)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
... 51 more

Name and version of the database you are using:
Oracle 9.2.0.1.0

Hi Folks,

I have been searching google, spring forum and this forum to find a hint on this error. No luck :-(

I try to get a jpa connection with hibernate under the hood. My Datasource config looks like this:
Code:
<bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url"  value="jdbc:oracle:thin:@myUrl:1700:MYDB" />
<property name="username" value="USER"/>
<property name="password" value="PASS" />
</bean>


I already tried adding something like this to my bean configuration:
Code:
<property name="connectionProperties">
   <props>
    <prop key="dialect">org.hibernate.dialect.Oracle9Dialect</prop>
   </props>
</property>


Still no luck...

Any hint on how to solve this problem would be very appreciated!

Thanks & Rgeards,

Christian


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 9:39 am 
Newbie

Joined: Wed Feb 13, 2008 1:05 pm
Posts: 1
Hi
If you're using the old classes12 driver lib there appears to be an issue where OracleDriver.getMajorVersion returns 0, this in turn confuses hibernate.
Upgrading to ojdbc14.jar fixed the problem for me. Another fix might be to figure a way to map 0 to your Oracle dialect but the mappings appear to be hardcoded at the moment in org.hibernate.dialect.DialectFactory. You could hack it I suppose.

Hope this helps,

Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 6:22 am 
Newbie

Joined: Fri Mar 14, 2008 5:56 am
Posts: 1
Hi guys

Just add that in your Spring conf:

<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>

I found that here:

http://topic.csdn.net/u/20070910/10/0bd ... ba54a.html

good luck

_________________
Abdellah


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.