velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hanasaki JiJi <hanas...@hanaden.com>
Subject Re: questions on RunTime Singleton
Date Wed, 18 Dec 2002 16:32:27 GMT
Ah.  so the Velocity Singleton does not maintain any state that 
implicitly requires a single JVM? (as in the case of a cache)

Geir Magnusson Jr. wrote:
> 
> On Wednesday, December 18, 2002, at 11:11 AM, Hanasaki JiJi wrote:
> 
>> I had thought there were issues with the same application running on 
>> multiple servers using singletons becuase each server has its own JVM 
>> yet a singleton can only exist in one JVM.
> 
> 
> Ignoring the complication that classloaders will bring into this 
> discussion, yes,  only one singleton can exist in a JVM.  However, each 
> JVM can have their own, as there is no 'conversation' between the JVMs 
> about this.
> 
> geir
> 
> 
>> ???
>>
>> Geir Magnusson Jr. wrote:
>>
>>> On Wednesday, December 18, 2002, at 10:26 AM, Hanasaki JiJi wrote:
>>>
>>>> Going through the Velocity API's and example code, there are several 
>>>> references to RuntimeSingleton.
>>>>
>>>> Is this class an issue for clustered/loadBalanced servers running 
>>>> velocity applications?  If so, how how can the this be addressed?
>>>
>>> ?
>>> I don't understand the question.  If you are doing load balancing, 
>>> and want to keep a users state in a session, then it doesn't matter 
>>> if you use the singlton or not - you have to take care of the problem 
>>> with either a shared store for state info, or a balancer that keeps 
>>> sessions sticky.
>>> The singleton just means that in a given JVM (or a webapp) all users 
>>> of it share the same instance, and thus the same configuration.  You 
>>> may find this useful (to share cached templates) or not (if you want 
>>> different configurations of the velocity engine at the same time...)
>>
>>
>> -- 
>> =================================================================
>> = Management is doing things right; leadership is doing the     =
>> =       right things.    - Peter Drucker                        =
>> =_______________________________________________________________=
>> =     http://www.sun.com/service/sunps/jdc/javacenter.pdf       =
>> =  www.sun.com | www.javasoft.com | http://wwws.sun.com/sunone  =
>> =================================================================
>>
>>
>> -- 
>> To unsubscribe, e-mail:   
>> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <mailto:velocity-user-help@jakarta.apache.org>
>>
>>

-- 
=================================================================
= Management is doing things right; leadership is doing the     =
=       right things.    - Peter Drucker                        =
=_______________________________________________________________=
=     http://www.sun.com/service/sunps/jdc/javacenter.pdf       =
=  www.sun.com | www.javasoft.com | http://wwws.sun.com/sunone  =
=================================================================


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message