geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdennis <patrickden...@managementdynamics.com>
Subject Re: Initialize Hibernate During Deployment
Date Mon, 03 Mar 2008 18:05:12 GMT

Hi David,

Thanks, that did work for me.

After your last post about listeners, I found this 
http://publib.boulder.ibm.com/wasce/V2.0.0/en/lifecycle-listeners.html#Lifecyclelisteners-webapp
article  about life cycle listeners, and I had a deploy error with the
<gbean> tags.

Your solution was app server independent and much easier to implement.

Thanks,

Patrick


djencks wrote:
> 
> 
> On Mar 3, 2008, at 7:20 AM, pdennis wrote:
> 
>>
>> Hi David,
>>
>> I do know what Hibernate is doing, it is reading the  
>> hibernate.cfg.xml file,
>> reading up the mapping files and creating a  
>> org.hibernate.SessionFactory.
>> All of this is in a static method in my HibernateUtil class.  This  
>> is how
>> Hibernate works with other app servers (as far as I know).
>>
>> What kind of listener do I need to create that gets triggered when  
>> the app
>> starts?  This sounds like what I'm trying to do.
> 
> I would think that if you included a load-on-startup element for one  
> of your servlets and called the static method in initialize() from  
> that servlet it would get called when the app is started?  Maybe I'm  
> missing something obvious.
> 
> thanks
> david jencks
> 
>>
>> -Patrick
>>
>>
>> djencks wrote:
>>>
>>> Do you have any idea what hibernate is doing?  Does this happen on
>>> other app servers?
>>>
>>> If you can figure out what is triggering the initialization you might
>>> be able to trigger it in a listener so it happens when the app  
>>> starts.
>>>
>>> thanks
>>> david jencks
>>>
>>> On Feb 29, 2008, at 11:50 AM, pdennis wrote:
>>>
>>>>
>>>> I followed the JBoss to
>>>> http://cwiki.apache.org/GMOxDOC20/jboss-to-geronimo-hibernate-
>>>> migration.html
>>>> Geronimo Hibernate Migration  to get Hibernate working in Geronimo,
>>>> and it
>>>> works just great.  My only problem is the first time I use
>>>> Hibernate in my
>>>> web application, it has to initialize which takes about 2 minutes.
>>>>
>>>> My question is, how do I get Geronimo to initialize Hibernate when
>>>> I deploy
>>>> my WAR, or when the WAR starts up (when Geronimo is restarted).
>>>> Has anyone
>>>> ever done this?
>>>>
>>>> Thanks,
>>>>
>>>> Patrick
>>>> -- 
>>>> View this message in context: http://www.nabble.com/Initialize-
>>>> Hibernate-During-Deployment-tp15766273s134p15766273.html
>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>> Nabble.com.
>>>>
>>>
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/Initialize- 
>> Hibernate-During-Deployment-tp15766273s134p15806149.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Initialize-Hibernate-During-Deployment-tp15766273s134p15809812.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message