You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Juergen Weber <we...@gmail.com> on 2009/01/15 13:39:05 UTC

Semantics of application restart

Hi, what happens if you restart an application from the console? 

I tried to cache properties loaded from an LDAP server in a pojo singleton.
I expected that if you restart an application, the classloader of the
application is thrown away and all classes re-instantiated.
But, looks like this is not the case, the singleton is still there after
restart.

I changed my code to empty the cache from the @PostConstruct method, this
works.

Thanks,
Juergen

-- 
View this message in context: http://www.nabble.com/Semantics-of-application-restart-tp21476759s134p21476759.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Semantics of application restart

Posted by Juergen Weber <we...@gmail.com>.
Don't know what I saw earlier, but it works as you say.

Thanks very much,
Juergen



djencks wrote:
> 
> 
> On Jan 15, 2009, at 4:39 AM, Juergen Weber wrote:
> 
>>
>> Hi, what happens if you restart an application from the console?
>>
>> I tried to cache properties loaded from an LDAP server in a pojo  
>> singleton.
>> I expected that if you restart an application, the classloader of the
>> application is thrown away and all classes re-instantiated.
>> But, looks like this is not the case, the singleton is still there  
>> after
>> restart.
> 
> I'm quite surprised at this, I also expected the classloader would be  
> re-created.  Are you certain the pojo is actually being loaded in the  
> application's classloader?
> 
> thanks
> david jencks
> 
>>
>>
>> I changed my code to empty the cache from the @PostConstruct method,  
>> this
>> works.
>>
>> Thanks,
>> Juergen
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Semantics-of-application-restart-tp21476759s134p21476759.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Semantics-of-application-restart-tp21476759s134p21498659.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Semantics of application restart

Posted by David Jencks <da...@yahoo.com>.
On Jan 15, 2009, at 4:39 AM, Juergen Weber wrote:

>
> Hi, what happens if you restart an application from the console?
>
> I tried to cache properties loaded from an LDAP server in a pojo  
> singleton.
> I expected that if you restart an application, the classloader of the
> application is thrown away and all classes re-instantiated.
> But, looks like this is not the case, the singleton is still there  
> after
> restart.

I'm quite surprised at this, I also expected the classloader would be  
re-created.  Are you certain the pojo is actually being loaded in the  
application's classloader?

thanks
david jencks

>
>
> I changed my code to empty the cache from the @PostConstruct method,  
> this
> works.
>
> Thanks,
> Juergen
>
> -- 
> View this message in context: http://www.nabble.com/Semantics-of-application-restart-tp21476759s134p21476759.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>