cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rosenstrauch <dar...@dti.net>
Subject Re: Request attributes?
Date Thu, 06 Dec 2001 15:52:51 GMT
At 08:52 AM 12/6/01 -0500, you wrote:
> > Temporary storage (and passing of vars down the chain) is precisely what I
> > use the attribs for. Here's a bit of code for sending an id to another
> > object via the Request object:
> > 
> > req.setAttribute("jbxsp-id",instanceId);
> > instance.setReq(req);
>
>Up to now I have used sessions to store objects needed further down the
>processing chain. I may be mistaken, but this approach seems to be a lot
>more efficient, assuming I don't need the object outside of the chain... Is
>this correct?
>
>Thanks.
>
>Diana



I'd say no.  For me the primary issue is holding onto unneeded data - which could be GC'd
much earlier if you stored it in a request object.

The lifetime of a session object is quite a bit longer than that of a single request.  Sessions
will hang around until invalidated, or until the expiration time arrives (if you don't explicitly
invalidate it).  So the server is holding onto lots of unneeded data until that time.

If you put it in a request object, the data can be GC'ed as soon as the request is finished.


DR


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message