-->
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.  [ 11 posts ] 
Author Message
 Post subject: Hibernate Middlegen plugin - cant find any tables
PostPosted: Thu Dec 04, 2003 10:23 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Hi,

When i am trying to run the Hibernate plugin for Middlegen to generate configuration mapping files it gives this exception "middlegen.MiddlegenException: Middlegen successfully connected to the database, but couldn't find any tables. Perhaps the specified schema or catalog is wrong? -Or maybe there aren't any tables in the database at all?"

Iam using the DB2 DB , i am sure that i have given the correct url, user id and password as you see it says succesfully connected and on top of that i had created quite a few tables making usage of the same properties and build file.

Please let me know what can be the problem?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 1:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The error is saying that it cannot find any tables. Maybe the tables are owned by a differnet user and appropriate grants have not been made for you. Maybe looking into a diffenet schema. You could try squirrel SQL or some other tool to see what tables can be viewed using a an alternative tool.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:21 am 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Hi David,

Thanks for the reply.

I did checked out various scenarios, i logged in with the same user in DB2 Database and created another table and even checked out what kind of grants are there (select,update,delet even administrative grants - everything is there). I have been able to select the records, update the records by making use of hibernate (with statless session bean, JBoss application server(Datasource configured with the same set of URL, userid,password) -- this also verifies that it has proper rights on the db tables.)

This is the latest free trail of DB2 personal edition i have downloaded to test things out and the driver file must be the recent one i.e. db2java.zip.

Can there be a problem with that driver ?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 10:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Middlegen makes heavy use of JDBC meta data facilities so if the driver does not provide that or its not good implementation then middlegen will not be able to ask the questions, such as, tell all the table names, now tell me all the columns and the types etc etc. You could code up a simple JDBC test to see what is returned by the JBDC driver.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Make sure you have enabled JDBC2 support in DB2 by running the little batch file!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2003 1:40 am 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
I wrote a sample test java class to get the metadata related information, in the end it came out that i had to give the schema name and table name in "UPPERCASE".

Thanks for all the help guys , in the end it is resolved and now the hibernate plugin for middlegen is running cool.

I can see that table name can be in UPPERCASE but i dont see any reasons why schema name to be in upper case? Any ideas guys? Is this a problem with the jdbc driver?

But in the end its resolved thats cool :)

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2003 9:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Cool - Glad you sorted out the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 11:43 am 
Newbie

Joined: Fri Dec 12, 2003 11:15 am
Posts: 2
Location: Columbus, OH
David,

I had the same problem occur as Vijpan, in getting the "no tables found" message, using Oracle8i personal edition on Win2K. I also determined that the schema name needs to be in uppercase. Now, middlegen seems to be getting SOMEWHERE with tables (where it says "no table elements specified, retrieving all tables, this may take awhile"...).

It used to fail with "no tables found" in about 10 seconds or less. No, however, it just sits there for about 5-6 minutes. On the Windows task manager I can see the Oracle service just keep sucking up more and more memory and using 99% of the CPU, eventually I get an exception related to the inability to allocate memory.

I've setup a user name specific for me, and I can use Squirrel and the oracle thin driver to see the tables and their contents. They are all there, as expected! There are only 8 tables, and none has more than 10 fields, so it is not that complex. Using MySQL, it only takes a few seconds and the GUI springs up with the tables.

Somewhere the wheels must be spinning, not sure where.

How does one specify specific table elements, so I could perhaps try it this way? Its not a big deal to include these elements since there are only 8 tables...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2003 10:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Sounds a little odd but I have never had much success with any Personal edition of Oracle. I use Oracle everyday and always install Enterprise edition. Its free for development so just use it. I can see you have done a few checks with other tools but anyway check that the JDBC driver is OK. Try the latest version for the database.

Anyway, there is a tag for the Ant task that can be used to define the tables that are to be processed. It is documented (sort of) on the Middlegen site. I don't spend any time testing it with this tag being used - should work fine but you never know.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 9:59 am 
Newbie

Joined: Fri Dec 12, 2003 11:15 am
Posts: 2
Location: Columbus, OH
David,

I decided to try your suggestion and deleted the Oracle personal edition and downloaded/installed Oracle Enterprise edition. Although I had to recreate the database from scratch (Oracle could see that the database existed, but would not accept any credentials), once I did this, the middlegen hibernate plugin worked as advertised. Lesson learned - Use Enterprise Edition, not Personal Edition. Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 3:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Great - I have seen plenty of problems/limitations with personal edition. Glad your up and running.


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