You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Zhang, Larry (L.)" <lz...@ford.com> on 2004/05/27 17:24:58 UTC
Session size
It is apparent true that if the session size is big, the performance will be negatively affected. The question is that how to actively control the size of session.
Let's discuss this question:
I have a page which displays all the subordinates of a manager, for some reasons I want to create a List or a Vector containing all the subordinates and put this List or Vector to the session. Each element in the List or Vector is a Java object, Employee( each Employee object has 200 String attributes, among which 5 are needed to be displayed on the screen)
A picture of this situation is:
Vector allSubordinates = new Vector();
allSubordinates.add(Employee1);
allSubordinates.add(Employee2);
.......
allSubordinates.add(Employee1000);
session.setAttribute("allSubordinates",allSubordinates);
Do you think this actually makes the session very big?
Then what will be the improvement of the following? Instead of add all the employee objects, we create a very small object called DisplayObject, which just contains the 5 attributes required on the screen.
Vector allSubordinates = new Vector();
allSubordinates.add(DisplayObject1);
allSubordinates.add(DisplayObject2);
.......
allSubordinates.add(DisplayObject1000);
session.setAttribute("allSubordinates",allSubordinates);
Your sharing of opinion is appreciated!
Thanks.
Larry
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session size
Posted by Riyad Kalla <rs...@email.arizona.edu>.
Why do you like ibatis? I've never heard of it, is it like OScache?
On Thursday 27 May 2004 09:08 am, Paul Barry wrote:
> Sounds like a good idea. I suggest that you look into using something
> like ibatis to handle the caching for you, and it definately won't take
> you a week to implement, even with the learning curve of ibatis.
>
> Riyad Kalla wrote:
> > Mike,
> > Good suggestions. I was dealing with something like this recently and
> > decided that for me, adding caching at the DAO level:
> >
> > e.g. List userList = UserDAO.getAllUsers();
> >
> > would offer the biggest performance benefit since it would be:
> >
> > (a) application wide, instead of per session
> > (b) returned Lists are 4-byte pointers to the actual list object cached
> > in the DAO
> > (c) The DAO itself handles all manipulation of those types, so it knows
> > when to invalid its own cache (on inserts/updates/removes)
> >
> >
> > What do people think about this strategy? (Before I spend a week
> > implementing it :)
> >
> > Best,
> > Riyad
> >
> > On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
> >>I personally think its too big. Large amounts of data like that should
> >>be put in request scope so that it gets flushed out of memory right
> >>away. If you need the data to be persistent through the user's session
> >>lifetime, mabye try serializing it to a database. Of course, different
> >>situations call for different solutions. Also, I would try and replace
> >>your Vector with a non-synchronized Collection like an ArrayList or
> >>LinkedList unless you have some sort of mutlithreaded access to this
> >>collection.
> >>
> >>Riyad Kalla wrote:
> >>>Larry,
> >>>Good question. I am curious what others think about this situation as
> >>>well.
> >>>
> >>>On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> >>>>It is apparent true that if the session size is big, the performance
> >>>> will be negatively affected. The question is that how to actively
> >>>> control the size of session.
> >>>>
> >>>>Let's discuss this question:
> >>>>
> >>>>I have a page which displays all the subordinates of a manager, for
> >>>> some reasons I want to create a List or a Vector containing all the
> >>>> subordinates and put this List or Vector to the session. Each element
> >>>> in the List or Vector is a Java object, Employee( each Employee object
> >>>> has 200 String attributes, among which 5 are needed to be displayed on
> >>>> the screen)
> >>>>
> >>>>A picture of this situation is:
> >>>>
> >>>> Vector allSubordinates = new Vector();
> >>>> allSubordinates.add(Employee1);
> >>>> allSubordinates.add(Employee2);
> >>>> .......
> >>>>
> >>>> allSubordinates.add(Employee1000);
> >>>>
> >>>>
> >>>>session.setAttribute("allSubordinates",allSubordinates);
> >>>>
> >>>>Do you think this actually makes the session very big?
> >>>>
> >>>>
> >>>>Then what will be the improvement of the following? Instead of add all
> >>>>the employee objects, we create a very small object called
> >>>>DisplayObject, which just contains the 5 attributes required on the
> >>>>screen.
> >>>>
> >>>> Vector allSubordinates = new Vector();
> >>>> allSubordinates.add(DisplayObject1);
> >>>> allSubordinates.add(DisplayObject2);
> >>>> .......
> >>>>
> >>>> allSubordinates.add(DisplayObject1000);
> >>>>
> >>>>
> >>>>session.setAttribute("allSubordinates",allSubordinates);
> >>>>
> >>>>Your sharing of opinion is appreciated!
> >>>>
> >>>>Thanks.
> >>>>
> >>>>Larry
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>For additional commands, e-mail: user-help@struts.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session size
Posted by Paul Barry <pa...@nyu.edu>.
Sounds like a good idea. I suggest that you look into using something
like ibatis to handle the caching for you, and it definately won't take
you a week to implement, even with the learning curve of ibatis.
Riyad Kalla wrote:
> Mike,
> Good suggestions. I was dealing with something like this recently and decided
> that for me, adding caching at the DAO level:
>
> e.g. List userList = UserDAO.getAllUsers();
>
> would offer the biggest performance benefit since it would be:
>
> (a) application wide, instead of per session
> (b) returned Lists are 4-byte pointers to the actual list object cached in the
> DAO
> (c) The DAO itself handles all manipulation of those types, so it knows when
> to invalid its own cache (on inserts/updates/removes)
>
>
> What do people think about this strategy? (Before I spend a week implementing
> it :)
>
> Best,
> Riyad
>
> On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
>
>>I personally think its too big. Large amounts of data like that should
>>be put in request scope so that it gets flushed out of memory right
>>away. If you need the data to be persistent through the user's session
>>lifetime, mabye try serializing it to a database. Of course, different
>>situations call for different solutions. Also, I would try and replace
>>your Vector with a non-synchronized Collection like an ArrayList or
>>LinkedList unless you have some sort of mutlithreaded access to this
>>collection.
>>
>>Riyad Kalla wrote:
>>
>>>Larry,
>>>Good question. I am curious what others think about this situation as
>>>well.
>>>
>>>On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
>>>
>>>>It is apparent true that if the session size is big, the performance will
>>>>be negatively affected. The question is that how to actively control the
>>>>size of session.
>>>>
>>>>Let's discuss this question:
>>>>
>>>>I have a page which displays all the subordinates of a manager, for some
>>>>reasons I want to create a List or a Vector containing all the
>>>>subordinates and put this List or Vector to the session. Each element in
>>>>the List or Vector is a Java object, Employee( each Employee object has
>>>>200 String attributes, among which 5 are needed to be displayed on the
>>>>screen)
>>>>
>>>>A picture of this situation is:
>>>>
>>>> Vector allSubordinates = new Vector();
>>>> allSubordinates.add(Employee1);
>>>> allSubordinates.add(Employee2);
>>>> .......
>>>>
>>>> allSubordinates.add(Employee1000);
>>>>
>>>>
>>>>session.setAttribute("allSubordinates",allSubordinates);
>>>>
>>>>Do you think this actually makes the session very big?
>>>>
>>>>
>>>>Then what will be the improvement of the following? Instead of add all
>>>>the employee objects, we create a very small object called
>>>>DisplayObject, which just contains the 5 attributes required on the
>>>>screen.
>>>>
>>>> Vector allSubordinates = new Vector();
>>>> allSubordinates.add(DisplayObject1);
>>>> allSubordinates.add(DisplayObject2);
>>>> .......
>>>>
>>>> allSubordinates.add(DisplayObject1000);
>>>>
>>>>
>>>>session.setAttribute("allSubordinates",allSubordinates);
>>>>
>>>>Your sharing of opinion is appreciated!
>>>>
>>>>Thanks.
>>>>
>>>>Larry
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session size
Posted by Riyad Kalla <rs...@email.arizona.edu>.
Mike,
Good suggestions. I was dealing with something like this recently and decided
that for me, adding caching at the DAO level:
e.g. List userList = UserDAO.getAllUsers();
would offer the biggest performance benefit since it would be:
(a) application wide, instead of per session
(b) returned Lists are 4-byte pointers to the actual list object cached in the
DAO
(c) The DAO itself handles all manipulation of those types, so it knows when
to invalid its own cache (on inserts/updates/removes)
What do people think about this strategy? (Before I spend a week implementing
it :)
Best,
Riyad
On Thursday 27 May 2004 08:49 am, Mike Zatko wrote:
> I personally think its too big. Large amounts of data like that should
> be put in request scope so that it gets flushed out of memory right
> away. If you need the data to be persistent through the user's session
> lifetime, mabye try serializing it to a database. Of course, different
> situations call for different solutions. Also, I would try and replace
> your Vector with a non-synchronized Collection like an ArrayList or
> LinkedList unless you have some sort of mutlithreaded access to this
> collection.
>
> Riyad Kalla wrote:
> >Larry,
> >Good question. I am curious what others think about this situation as
> > well.
> >
> >On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> >>It is apparent true that if the session size is big, the performance will
> >>be negatively affected. The question is that how to actively control the
> >>size of session.
> >>
> >>Let's discuss this question:
> >>
> >>I have a page which displays all the subordinates of a manager, for some
> >>reasons I want to create a List or a Vector containing all the
> >> subordinates and put this List or Vector to the session. Each element in
> >> the List or Vector is a Java object, Employee( each Employee object has
> >> 200 String attributes, among which 5 are needed to be displayed on the
> >> screen)
> >>
> >>A picture of this situation is:
> >>
> >> Vector allSubordinates = new Vector();
> >> allSubordinates.add(Employee1);
> >> allSubordinates.add(Employee2);
> >> .......
> >>
> >> allSubordinates.add(Employee1000);
> >>
> >>
> >>session.setAttribute("allSubordinates",allSubordinates);
> >>
> >>Do you think this actually makes the session very big?
> >>
> >>
> >>Then what will be the improvement of the following? Instead of add all
> >> the employee objects, we create a very small object called
> >> DisplayObject, which just contains the 5 attributes required on the
> >> screen.
> >>
> >> Vector allSubordinates = new Vector();
> >> allSubordinates.add(DisplayObject1);
> >> allSubordinates.add(DisplayObject2);
> >> .......
> >>
> >> allSubordinates.add(DisplayObject1000);
> >>
> >>
> >>session.setAttribute("allSubordinates",allSubordinates);
> >>
> >>Your sharing of opinion is appreciated!
> >>
> >>Thanks.
> >>
> >>Larry
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Navigation Bar
Posted by Zaid <za...@cosmos-software.com>.
Dear Friends,
I am new Struts developer, meanwhile I did huge coding in PHP; however, I
am trying to find a custom tag which can work as a navigation bar, the
specification on the bar shoulf contain next, prev, first and last as
well.
could anyone help me in finding useful one ? I would be very much
appreciated.
Best Regards to all
Zaid
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session size
Posted by Mike Zatko <mz...@boscovs.com>.
I personally think its too big. Large amounts of data like that should
be put in request scope so that it gets flushed out of memory right
away. If you need the data to be persistent through the user's session
lifetime, mabye try serializing it to a database. Of course, different
situations call for different solutions. Also, I would try and replace
your Vector with a non-synchronized Collection like an ArrayList or
LinkedList unless you have some sort of mutlithreaded access to this
collection.
Riyad Kalla wrote:
>Larry,
>Good question. I am curious what others think about this situation as well.
>
>On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
>
>
>>It is apparent true that if the session size is big, the performance will
>>be negatively affected. The question is that how to actively control the
>>size of session.
>>
>>Let's discuss this question:
>>
>>I have a page which displays all the subordinates of a manager, for some
>>reasons I want to create a List or a Vector containing all the subordinates
>>and put this List or Vector to the session. Each element in the List or
>>Vector is a Java object, Employee( each Employee object has 200 String
>>attributes, among which 5 are needed to be displayed on the screen)
>>
>>A picture of this situation is:
>>
>> Vector allSubordinates = new Vector();
>> allSubordinates.add(Employee1);
>> allSubordinates.add(Employee2);
>> .......
>>
>> allSubordinates.add(Employee1000);
>>
>>
>>session.setAttribute("allSubordinates",allSubordinates);
>>
>>Do you think this actually makes the session very big?
>>
>>
>>Then what will be the improvement of the following? Instead of add all the
>>employee objects, we create a very small object called DisplayObject, which
>>just contains the 5 attributes required on the screen.
>>
>> Vector allSubordinates = new Vector();
>> allSubordinates.add(DisplayObject1);
>> allSubordinates.add(DisplayObject2);
>> .......
>>
>> allSubordinates.add(DisplayObject1000);
>>
>>
>>session.setAttribute("allSubordinates",allSubordinates);
>>
>>Your sharing of opinion is appreciated!
>>
>>Thanks.
>>
>>Larry
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
--
Michael H. Zatko
WebSphere Developer
Boscov's Information Services
Work: 610-929-7317
Home: 610-562-2407
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Session size
Posted by Riyad Kalla <rs...@email.arizona.edu>.
Larry,
Good question. I am curious what others think about this situation as well.
On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote:
> It is apparent true that if the session size is big, the performance will
> be negatively affected. The question is that how to actively control the
> size of session.
>
> Let's discuss this question:
>
> I have a page which displays all the subordinates of a manager, for some
> reasons I want to create a List or a Vector containing all the subordinates
> and put this List or Vector to the session. Each element in the List or
> Vector is a Java object, Employee( each Employee object has 200 String
> attributes, among which 5 are needed to be displayed on the screen)
>
> A picture of this situation is:
>
> Vector allSubordinates = new Vector();
> allSubordinates.add(Employee1);
> allSubordinates.add(Employee2);
> .......
>
> allSubordinates.add(Employee1000);
>
>
> session.setAttribute("allSubordinates",allSubordinates);
>
> Do you think this actually makes the session very big?
>
>
> Then what will be the improvement of the following? Instead of add all the
> employee objects, we create a very small object called DisplayObject, which
> just contains the 5 attributes required on the screen.
>
> Vector allSubordinates = new Vector();
> allSubordinates.add(DisplayObject1);
> allSubordinates.add(DisplayObject2);
> .......
>
> allSubordinates.add(DisplayObject1000);
>
>
> session.setAttribute("allSubordinates",allSubordinates);
>
> Your sharing of opinion is appreciated!
>
> Thanks.
>
> Larry
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org