-->
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.  [ 12 posts ] 
Author Message
 Post subject: Problem using Hibernate 3.0.4 on Oracle
PostPosted: Mon May 23, 2005 6:16 am 
Newbie

Joined: Tue Sep 21, 2004 10:09 am
Posts: 5
Location: Rome, Italy
Hello,

it seems that some Oracle JDBC drivers lack of an implementation of java.sql.DatabaseMetaData.getDatabaseMajorVersion(), resulting in java.lang.AbstractMethodError while calling this method from org.hibernate.cfg.SettingsFactory.buildSettings().

Looking into the CVS repository I've seen that this method was introduced from version 1.31 of org.hibernate.cfg.SettingsFactory, tag v304.

I have downloaded the latest driver from Oracle website, but the problem still occurs. I Think this is an Oracle bug, but if Hibernate doesn't use the major version number any more, we can safely hide this kind of error in a try/catch statement without breaking the behaviour of org.hibernate.cfg.SettingsFactory.buildSettings().

Regards

Pietro Pizzo

Hibernate version: 3.0.4
Full stack trace of any exception that occurs:
Code:
java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.getDatabaseMajorVersion()I
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at com.eds.domainstore.hibernate.HibernatePersistenceManagerFactory.<init>(HibernatePersistenceManagerFactory.java:173)
   at com.eds.domainstore.PersistenceManagerFactory.<clinit>(PersistenceManagerFactory.java:161)
   at com.eds.wind.ndbweb.to.test.TOTest.setUp(TOTest.java:48)
Name and version of the database you are using: Oracle9i Enterprise Edition Release 9.2.0.5.0


Top
 Profile  
 
 Post subject: Same problem with DB2
PostPosted: Mon May 23, 2005 11:57 am 
Newbie

Joined: Mon May 23, 2005 11:31 am
Posts: 2
I have the same problem with DB2 and Oracle after upgrading to version 3.0.4. But I do not think it is a driver problem but a JDK version problem. I am currently using jdk 1.3 and the method java.sql.DatabaseMetaData.getDatabaseMajorVersion() does not exist http://java.sun.com/j2se/1.3/docs/api/java/sql/DatabaseMetaData.html.
but does exists in http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html

Looking at the source for org.hibernate.cfg.SettingsFactory i see it referenced in that way.
Code:
DatabaseMetaData meta = conn.getMetaData();
databaseName = meta.getDatabaseProductName();
databaseMajorVersion = meta.getDatabaseMajorVersion();


I did not see the JDK requirements change for this version. Please let me know if I am missing something.

Hibernate version: 3.0.4
Name and version of the database you are using: IBM DB2 07.01.0002 and Oracle9i Enterprise Edition Release 9.2.0.6.0
Full stack trace of any exception that occurs:
Code:
java.lang.NoSuchMethodError: java.sql.DatabaseMetaData: method getDatabaseMajorVersion()I not found
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at cat.euro.server.util.hbm.HibernateUtil.<init>(HibernateUtil.java:44)
   at cat.euro.server.util.hbm.HibernateUtil.<clinit>(HibernateUtil.java:33)
   at cat.euro.server.util.hbm.HbmBaseDAO.getSession(HbmBaseDAO.java:31)
   at cat.eur.da.absenteism.dao.SecurityDAO.getSecurity(SecurityDAO.java:45)
   at cat.eur.da.absenteism.service.SecurityService.getRules(SecurityService.java:46)
   at cat.eur.da.absenteism.service.AbsentService.getUser(AbsentService.java:273)
   at cat.euro.test.TestEmployeeReport.testReportMove(TestEmployeeReport.java:94)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 23, 2005 1:33 pm 
Newbie

Joined: Mon May 23, 2005 1:31 pm
Posts: 1
This issue was posted to JIRA, and Gavin rejected it:
http://opensource.atlassian.com/project ... se/HHH-514


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 23, 2005 3:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
That bug report said the problem was the Oracle driver. In fact, the problem is that 3.0.4 is calling a JDBC3 method that does not even exist in JDK1.3. We'll need to fix that.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 3:32 am 
Newbie

Joined: Mon May 23, 2005 11:31 am
Posts: 2
Thank you. I will wait for next version or patch.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 11:30 am 
Newbie

Joined: Tue May 24, 2005 11:25 am
Posts: 16
gavin wrote:
That bug report said the problem was the Oracle driver. In fact, the problem is that 3.0.4 is calling a JDBC3 method that does not even exist in JDK1.3. We'll need to fix that.


What are your time estimates for this bug?


Top
 Profile  
 
 Post subject: Also happens with MS SQL Server 2000
PostPosted: Tue May 24, 2005 11:57 pm 
Newbie

Joined: Tue May 24, 2005 10:40 pm
Posts: 8
Location: Sydney, Australia
I found the same problem after upgrading to Hibernate 3.0.4. I'm using V2.2.0040 of the SQL Server 2000 driver, which is the latest AFAIK.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 5:39 am 
Newbie

Joined: Tue May 24, 2005 11:25 am
Posts: 16
Again: what are your time estimates for this bug? Sorry for repeating but I think this bug is so critical that you cannot call this version "production" until it's resolved.

A bit of offtopic: is this correct Hibernate v2 behavior that in case of many to many from both sides and lazy=false Hibernate loads the whole graph without any limits on level. In other words there is no way in Hibernate v2 to limit the graph being loaded (I don't want to set lazy=true on class level).


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 4:54 am 
Newbie

Joined: Tue May 24, 2005 11:25 am
Posts: 16
up


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 11:11 am 
Newbie

Joined: Tue May 24, 2005 11:25 am
Posts: 16
up


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 11:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Stop doing that or you'll be banned.

Now, if you would have bothered to spend the time and do the research yourself, instead of waiting for people to hand you everything on a plate, you would notice that there is a Hibernate 3.0.5 release out. Read the changelog.

Geez!


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Thu May 26, 2005 7:04 pm 
Newbie

Joined: Tue May 24, 2005 10:40 pm
Posts: 8
Location: Sydney, Australia
Thanks for fixing this, Gavin.

I'm glad you no longer require the JDBC drivers to implement all the getXXXVersion methods, as I wasn't holding out any hope for MS doing that in their SQL Server driver any time soon...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.