-->
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.  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Hibernate 3 Tool takes too long to generate or not generatin
PostPosted: Thu May 05, 2005 5:12 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
We are migrating from Hibernate 2 to Hibernate 3.02. We have 181 tables in our database. When we use the artifact generation tool in Eclipse to reverse engineer to get the hbm files and generate the POJOs it seems to be taking forever. Is there bug in the tool that it can not handle over a certain amount of tables. If so how can I fix it. I let the tool run for over 30 minutes and it did not complete it, so I got tired and terminated it.

Could someone please shine some light into this matter!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:31 pm 
Regular
Regular

Joined: Mon Apr 25, 2005 9:22 am
Posts: 62
Location: Bucharest/Romania
I am using the Ant task to generate the hbm (MS SQL Server 2k) for about 80 tables and 80 views. The Ant tasks is using the same underlying mechanisms as the UI part. It runs in reasonable time. It may be possible that somewhere in your env you have references to the old 2.0 dtd?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i dont know of such a bug.

I know that certain databases are VERY slow when askinga about metadata (like oracle).

One thing that can speed things up would be to set the default schema and catalog to limit the rev.eng. to the relevant schema instead of whole db.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:42 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
Which ant task do you speak of? I do not see any ant build file in the tools folder. Did you create it yourself.

All we did was to ask the tool to generate the hibernate.cfg.xml. Second we create the console using the hibernate.cfg.xml. Finally we ask the artifact generation tool to create the hbm files. I do not think we could have messed up some setting in between any of these stages.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:46 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
Max, we did specify the default schema and yet it does not work. One of my other colleagues had it running for 45 minutes, and than Eclipse gave an error stating that it ran out of memory. We don't know what else to do.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmmm....have you tried downloading the latest version from the jboss ide download ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:54 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
No I got it from Hibernate.org. I am downloading the tools from jboss as we speak. Let me try it and I will let you know Max. Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
but please note that if you are e.g. using oracle then you will have to wait for 181 calls to getImportedKeys() via DatabaseMetadata and that stuff is *slow* on oracle!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:07 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
Ok Max here is what is happing. Even with the other plugin as well as this one. The tool will try to generate the hbm files for about 30 minutes. Than I get the out of heap memory error. When I look to see what it created, I see it created some hbms but only 123 of them. I don't know what happens but it does not complete it as it should have created 181 hbm files.

I looked at my server while the tool was generating and I see that it is accessing tables as the server states that the user is accessing "SHOW CREATE TABLE xx.x" I know it is working but I noticed that it is repeating some of the tables that it retrieved. It seems to be going in an infinited loop.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:07 pm 
Regular
Regular

Joined: Wed Sep 29, 2004 11:34 am
Posts: 62
Location: Houston, TX
Max I am using MySQL Database


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:09 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
try filter objects (tables/views) with http://opensource.atlassian.com/project ... se/HBX-250

regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:13 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
but please note that if you are e.g. using oracle then you will have to wait for 181 calls to getImportedKeys() via DatabaseMetadata and that stuff is *slow* on oracle!


what database do getImportedKeys for 181 tables quick ? have you try ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - the algorithm for scanning should be pretty free of any loops.

the logic is:

1. get all tables
2. for eacht table get all foreignkeys

would be really interesting to set the database schema ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hsqldb, ms sql, mysql does not use many seconds to do it. Oracle can uses minutes.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 6:56 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
hsqldb, ms sql, mysql does not use many seconds to do it. Oracle can uses minutes.


181 tables for not many seconds ? if yes, how many constraints exists in database ?

I try different databases and oracle is quicker, special in applications with many concurrent users

I like postgresql too, but it is hard change objects in complicated schemas (I have to delete all dependencies objects)

I have oracle with > 30 schemas/users (it is similar for testing), > 4500 tables with PK, about 4000 views, > 6000 referential constraints and it is quick except when I try load all objects - it isn't slow than eat memory

without my reverse plugin I can't work with this database, but with plugin it work fine -
slow part is print velocity messages

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 31 posts ]  Go to page 1, 2, 3  Next

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.