struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: Re[4]: Struts and Large ResultSet
Date Thu, 22 Aug 2002 20:27:53 GMT
If your table is set up to increasingly autonumber new records you could do 
this type of query.  Let's say it's a product table with primary key 
ProductID that is autonumbered.

select *
from product
where (productid > lastDisplayedID) AND
(productid < lastDisplayedID + 20)

Where lastDisplayedID is a variable from your jsp telling it what the last 
id it displayed was.

So each new screen would have to do the query again but it eliminates the 
huge amount of records sitting in memory.  Also, if records are deleted, the 
worst that could happen is your query returns 19 records instead of 20.  You 
don't have to worry about synchronizing your cached data with real data.

Dave

>
>Hi,
>I went through all the mails on this topic, but the problem is i cannot say 
>that i want item between 20 and 40 ( i m developing item master)  also i 
>cannot get the keys and keel them in session as at some time the item may 
>be deleted from main database and then i will have to check for the 
>conditions when loading data,
>My database is as400 which does not allow row count etc available in oracle 
>and sybase, has anyone used apache torque, i guess it helps inhandling this 
>type of problems, also i am studying the j2ee pattern.
>And beleive me people for whom i am developing software go through millions 
>of records in a day..
>Ashish
>  Rick Reumann wrote:On Thursday, August 22, 2002, 3:36:38 PM, Jacob wrote:
>
>JH> Or if you have the ability to set max rows returned on the query,
>JH> just set a single break point with a page counter and the next
>JH> button would just select the next 20 where id > last viewed in a
>JH> sorted order that is consistent throughout your search results.
>
>Beautiful! Thanks. Now why I didn't I think of that:)...( ummm
>'cause you're a dumbass:)
>
>Just curious, how big is 'too big' of a collection to store in
>request and/or session scope? I love the functionality of this
>display tag http://edhill.its.uiowa.edu/display/ but if I happen
>to be dealing with huge(?) lists this might not be an option any
>more and I'm going to go with the idea you've suggested.
>
>Thanks again.
>
>--
>
>Rick
>mailto:maillist@reumann.net
>
>
>--
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>
>
>A$HI$H
>
>
>---------------------------------
>Do You Yahoo!?
>HotJobs, a Yahoo! service - Search Thousands of New Jobs




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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


Mime
View raw message