|
Hi, I´m using a legacy database to run grails. This database has about 2500 tables and 30000 fields.
I just create one domain object to one of this tables. When I start with "grails run-app" it takes about 2 minutes to go and display "Browse to http..." What is going on ? Thanks |
|
You can set the log level to debug to see lots and lots of information about what grails/hibernate/spring are doing.
Is there any errors on the log? Any particular moment that the startup process freezes?
Regards,
--- Felipe Cypriano On Tue, Nov 17, 2009 at 1:52 PM, larini <[hidden email]> wrote:
|
|
Hi Felipe, I dont´t know how exactly how I turn this debug level on.
Can you help me ? |
|
You can configure the log level in grails-app/conf/Config.groovy file. Read this http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.1.2%20Logging to learn what to do.
--- Felipe Cypriano On Tue, Nov 17, 2009 at 2:58 PM, larini <[hidden email]> wrote:
|
|
This is the bad boy: hibernate.ConfigurableLocalSessionFactoryBean - Building new Hibernate SessionFactory What´s it doing ? -- View this message in context: http://old.nabble.com/Grails-take-a-long-time-to-start-tp26392305p26396454.html Sent from the grails - user mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by larini
This is the big boy:
hibernate.ConfigurableLocalSessionFactoryBean - Building new Hibernate SessionFactory Whats is it doing ? How can I accelerate this process ? |
|
Am i reading it correctly that you are initializing (or ultimately intend to) grails with 2500 Domain objects having a sum total of 30000 fields, ie columns?
On Tue, Nov 17, 2009 at 12:05 PM, larini <[hidden email]> wrote:
-- "We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Dr. Niels Bohr ### Craft @ http://www.linkedin.com/in/jpimmel ### Vox @ http://act.ualise.com/blogs/continuous-innovation ### Twit @ http://twitter.com/franklywatson |
|
My database has 2500 tables, but may grails app has only one domain object created.
|
|
> My database has 2500 tables, but may grails app has only one domain object
> created. It's not clear whether it's Hibernate or Grails that's spending all that time configuring the domain. Maybe Hibernate is scanning all the tables? They certainly say that the SessionFactory is an expensive object to create. Perhaps that's a feature that can be disabled, but I don't know, sorry. Cheers, Peter --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Somebody know how can I turn off the Hibernate sessionFactory creation, or to force it to create only the domain objects that I had defined? |
|
You can't disable the SessionFactory it's responsible for all sessions and mappings that you'll use in your application.
You should ask this question in Hibernate forum to see if they have any clues about how to speed up the session factory creation. --- Felipe Cypriano On Wed, Nov 18, 2009 at 8:27 AM, larini <[hidden email]> wrote:
|
|
Ok, in a production environment this is not a real problem, but when developing, this makes impossible to use Grails in this project. |
|
> Ok, in a production environment this is not a real problem, but when
> developing, this makes impossible to use Grails in this project. Do you really need to restart the server so often in development mode? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
No, but it looks like grails to this for itself when I save a domain object or a controller. |
|
Just curious, what happens if you start your app against a DB with the only table you map to your domain class?
|
|
Hi, I already tried this, and Grails startup is about 10 seconds. |
|
In reply to this post by larini
> No, but it looks like grails to this for itself when I save a domain object
> or a controler. Changing a domain class will trigger a server restart, but changes to controllers, tag libraries, views, services, i18n properties files, etc. won't. BTW, I'm not suggesting there isn't a problem here, just that you might be able to manage in development mode if you only modify domain classes intermittently. I would certainly second another poster's suggestion that you ask on the Hibernate forums, just in case there is a workaround. Or they may say it's a Grails issue, which would help us. Cheers, Peter --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by larini
Hmmm
I don't see a reason, why would a Hib's SF scan all tables even those, not mapped. What do you have in your BootStrap? You can also turn the show_sql=true to see what happens during the start-up. |
|
What a simple solution !
I set the dbCreate parameter in the DataSource.groovy file to off: development { dataSource { dbCreate = "off" // one of ‘create’, ‘create-drop’,'update’ url = "jdbc:oracle:thin:@xyz:1521:xyz" } }
|
| Powered by Nabble | Edit this page |
