-->
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.  [ 5 posts ] 
Author Message
 Post subject: HibernateTool Artifact Generation fails due to GenericJDBCEx
PostPosted: Thu May 12, 2005 9:44 am 
Beginner
Beginner

Joined: Tue Jan 11, 2005 5:50 am
Posts: 43
Location: Zurich (Suisse)
Name and version of the database you are using:
Oracle 10g

Error message:

Error under artifact generation
org.hibernate.exception.GenericJDBCException:Reading from database

Hibernate.cfg.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
       <property name="hibernate.show_sql">true</property>
        <property name="hibernate.connection.username">user</property>
        <property name="hibernate.connection.password">passw</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@host:port:sid</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.default_schema">MY_SCHEMA</property>
    </session-factory>
</hibernate-configuration>


Hello

I am having the problem that I cannot generate the mapping files out of a Oracle 10g database with the HibernateTool. As a driver I use the classes12.jar driver package which I downloaded from the oracle 10g site.

Yesterday I tried the approach with middlegen, having the same configuration resulting in that middlegen could not read any metadata, it read the tables and columns but no constraints at all.

If anyone could help me with anything I'd be happy.

Thanks.

Tarik

Code:


Top
 Profile  
 
 Post subject: Stack Trace
PostPosted: Thu May 12, 2005 11:19 am 
Beginner
Beginner

Joined: Tue Jan 11, 2005 5:50 am
Posts: 43
Location: Zurich (Suisse)
The stack trace, which I found only yet:

Code:
org.hibernate.exception.GenericJDBCException: Reading from database
   at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
   at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:125)
   at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: java.sql.SQLException: Getrennte Verbindung
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226)
   at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:734)
   at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:651)
   at oracle.jdbc.driver.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:258)
   at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:708)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:106)
   ... 8 more


"Getrennte Verbindung" means "Closed Connection".


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 12:33 pm 
Beginner
Beginner

Joined: Tue Jan 11, 2005 5:50 am
Posts: 43
Location: Zurich (Suisse)
Well I tried and tested with ant skript sql task, everything works, middlegen worked halfways, could not read the primary keys but still held a connection. Is there someone who could tell me if it has worked with Oracle 10g?


Top
 Profile  
 
 Post subject: Well error was somewhere "else"
PostPosted: Wed May 18, 2005 4:46 pm 
Beginner
Beginner

Joined: Tue Jan 11, 2005 5:50 am
Posts: 43
Location: Zurich (Suisse)
In case someone has a similar issue.

The database was set up wrong, the PK was not used, instead only unique keys.

So Middlegen ran fine, but I got another issue trying to use hbm2java, which was not implemented in the last release as I understood. So to circumvent it I generated the hbm's with middlegen and the sources with the hibernate 2 binaries.

I am still quite new to "all of it" and "everything mixed" but thanks a lot to the hibernate team, you are doing really an awesome good piece of software.


Top
 Profile  
 
 Post subject: Re: Stack Trace
PostPosted: Thu Jun 02, 2005 7:06 am 
Newbie

Joined: Thu Jun 02, 2005 7:02 am
Posts: 1
I also have the same problem.
I have traced Oracle session and found that, too many cursor opened....


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