You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike Quilleash <mi...@subexazure.com> on 2006/11/21 10:26:57 UTC

Tomcat and long startup time (hibernate)

Hi there,
 
I am working on a new J2EE web project for which I intend to use JSF 1.2
with facelets and hibernate 3 running inside Tomcat 6.  Everything is
working fine but I have a developing issue I would like to try and work
around.
 
I am building a global hibernate session factory, which is stored in a
static singleton, in a ServletContextListener so it is available when
the JSF application starts.  In the development process I'm constantly
editing the JSF Java code and display pages and redeploying the web app.
Each time I do this the hibernate layer has to reinitialise which takes
about 30-40 seconds.
 
My question is, is there anyway in Tomcat of moving/configuring the
hibernate intialisation (and more generally any heavy initialisation
code) so that I can redeploy the JSF application quickly without
reinitialising hibernate?  Something along the lines of having Tomcat
doing the heavy initialisation once but separate from the JSF
application so I can redeploy the JSF without incurring the hibernate
startup each time?  I thought about a different deployed application
with the hibernate logic but I'm not sure how to do this and I'm also
not sure about classloading issues; can the JSF app "see" the hibernate
static if it is loaded in different webapp/context.
 
I develop/debug on IDEA6 using it's Tomcat plugin.
 
Appreciate any help or suggestions.  I'm new to Tomcat so I apologise if
any of the terminology is wrong.  I am happy to provide more detail
clarifications if required.
 
Thanks in advance.
 
Mike.
 

 This e-mail is bound by the terms and conditions described at http://www.subexazure.com/mail-disclaimer.html


RE: Tomcat and long startup time (hibernate)

Posted by snowtoad <tk...@landacorp.com>.
Thanks Mike, 

I will have a look at your patch, I am glad you have seen the significant
speedup. I am also fairly new to the hibernate code base, did you also
have to modify the collections persisters? or is all byte code
instrumentation done at the entity level?

It would be a huge win if Max will add your stuff to the core, so we
don't have to keep patching hibernate every time a new release is
put out.

Tyler.


>I've looked at this issue in hibernate's JIRA and I noticed a post you
>made about the possibility of moving the laziness into the
>EntityPersistor instead.  From my previous experience the majority of
>the hibernate startup time is building the proxy objects (cglib) for
>lazy entities.
>
>I've made some changes locally which has sped up the hibernate startup
>time significantly.  I've posted on the JIRA under the issue you
>mentioned


-- 
View this message in context: http://www.nabble.com/Tomcat-and-long-startup-time-%28hibernate%29-tf2677735.html#a7603923
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat and long startup time (hibernate)

Posted by snowtoad <tk...@landacorp.com>.
Hi Mike,

Check out the following bug report, I had a similar issue and my solution
was to modify the hibernate session factory so that it only instruments
persistent objects as they are encountered for the first time. I attached a
patch  to the bug report which is a modified session factory that implements
the on-demand instrumentation. This greatly reduces the startup time of
hibernate.

http://opensource.atlassian.com/projects/hibernate/browse/HHH-1258

-- 
View this message in context: http://www.nabble.com/Tomcat-and-long-startup-time-%28hibernate%29-tf2677735.html#a7583744
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org