You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nikhil Sidhaye <n_...@mail15.com> on 2004/02/02 04:22:05 UTC

Re: Struts + displaytag = delay

Hi Andy ,

      Can you reproduce the same results with hardcoded ArrayList objects 
(without connecting database)?

./Nikhil

On Fri, 30 Jan 2004 08:40:14 -0800 (PST), Andy Engle <st...@andyengle.com> 
wrote:

> Hi all,
>
> I am using displaytag in a Struts app that I am working with, and so
> far it seems to be all good, except when I incorporate pagination into
> one of my actions.  I have an ArrayList of objects that I am getting
> from the database, which I am placing in session scope when I get the
> list built.  From there, I am eventually sending that back to the JSP,
> which uses the displaytag to show the results.  For the first three
> pages I load (of maybe five pages of results), it seems to work well,
> but then when I click on pages after the second or third click, it
> seems that there is a delay of maybe 10 seconds in getting the
> subsequent pages of results to load.  It seems like this should be
> pretty quick, right?  After all, my data is already loaded, it's set as
> a session value, and I shouldn't have to go back to the database and
> pickup all the data again.
>
> I am using Tomcat 5.0.14 with Oracle 8.1.7.  Any help provided would of
> course be very much appreciated.
>
> Have a great day.
>
>
> Andy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



-- 
---------------------------------
A mind once stretched by a new idea,
Never regains its original dimensions.
---------------------------------

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


Re: Struts + displaytag = delay

Posted by Andy Engle <st...@andyengle.com>.
On Feb 1, 2004, at 9:22 PM, Nikhil Sidhaye wrote:

> Hi Andy ,
>
>     Can you reproduce the same results with hardcoded ArrayList
> objects (without connecting database)?

Hey there.  I found that the problem was actually do to reloading the
bean with the data from the database each time I was loading a page. 
Each time I wanted to go through the data I was hitting the database,
which was causing the delay.  The way I worked around it is that in my
action class I am checking what the query string is that I am passing
in.  If the query string is null, then that means that I am probably
not doing any of the fancy stuff with displaytag, such as sorting,
going through the pages, etc.  So, if that query string is null, that
is when I am hitting the database, loading the data into a bean, and
shleping that into the session scope.  If there is a query string, I
just stick with what I already have in the bean.

One of the other members of this mailing list (Zoran Avtarovski)
suggested that I look into the use of iBatis, which I got more into
today.  I am going to figure out how I can get all that to work, which
Zoran suggested would probably take care of the problem in addition to
making it a more efficient solution.

Anyway, to answer your question, I don't have the same results when I
work without hitting the database.  It's only when I hit the database
multiple times that I get the delay, which is due to our database
server being overloaded with so much junk.  I wish (the company I work
for) would spend some money and get us some new servers that can handle
the load!  They did just get us dualies with a gig of memory, which was
nice though.

Thanks for responding!


Andy


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