struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoang, Hai" <Hai.Ho...@coair.com>
Subject RE: Session Cleanup
Date Thu, 17 Oct 2002 20:49:39 GMT
I often stored my form beans in a session scope.  I've a routine that
looping through the session and destroy the unused forms.  The tricky part
is how to determine with forms are no longer in used.

Anyone out there using this technique?

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org] 
Sent: Thursday, October 17, 2002 3:37 PM
To: Struts Users Mailing List
Subject: Re: Session Cleanup



On Thu, 17 Oct 2002, atta ur-rehman wrote:

> Date: Thu, 17 Oct 2002 13:36:41 -0700
> From: atta ur-rehman <attaurrehman@kapsconsulting.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> Subject: Re: Session Cleanup
>
> Thanks, David. Putting commonly used collection in the application scope
is
> a nice idea; both for storage space and performance reasons.
>
> Now how do I store my form beans in request instead of session? Is it the
> "scope" attribute of the action mapping that determines it?

Yes.

> And what are
> performance implications of this change?

The set of attributes in the request or session object supplied by the
servlet container is usually a HashMap, so performance of storing the form
bean in either is equivalent.  However, your app will benefit from the
fact that the form bean is automatically released at the end of the
request, so the overall memory occupancy of your app will likely be lower,
but the CPU time consumption might be higher (due to increased garbage
collection).

For most apps, this tradeoff is very much worth it because having excess
CPU capacity is more common than having excess memory to store the form
beans in session scope in between requests.

>
> Regards,
>
> ATTA

Craig


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


_________________________________________________________________________
Introducing the all new and improved continental.com.  With a totally new 
personalized design, it's the best place to go. Before you go.

Continental Airlines. Work Hard. Fly Right.

http://www.continental.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message