velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Esposito" <espos...@newnetco.com>
Subject RE: Thread safety
Date Mon, 01 Oct 2001 21:02:24 GMT
Is there something fancy that goes on with the Context during the merge()
that would make it non-thread-safe? Or is it just concern over the fact that
#set() operations will change the content of the Context? (which isn't
thread safe)

I haven't stress tested the hell out of it but I have a "default" context
(with a bunch of global variables, tools, etc...) that I nest inside of the
context that is created during each request ...

VelocityContext ctx = new VelocityContext(defaultContext);

is that safe?

> -----Original Message-----
> From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
> Sent: Monday, October 01, 2001 6:00 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Thread safety
>
>
> On 10/1/01 4:24 AM, "Bojan Smojver" <bojan@binarix.com> wrote:
>
> > Are Template.merge() and VelocityEngine.getTemplate() thread safe?
> >
> > Bojan
>
> merge() is as long as you don't share a VelocityContext across
> simultaneous
> threads.
>
> getTemplate() should be as well.
>
> Er, why?  Problems?
>
> --
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> "Whoever would overthrow the liberty of a nation must begin by
> subduing the
> freeness of speech." - Benjamin Franklin
>
>


Mime
View raw message