On 13.May.2002 -- 09:31 AM, Evan Sho wrote:
> Just skim thur the suggestions. However, I have a
> question very fundamental to that in the pipeline
> process. If the pagination is done in transformer, it
> means the generator will have all result generated and
> the transformer just cut out the unwanted one. It
> could means many rows in the result will be unused.
> Also, even the generator is cached, many un-usually
> used rows will be in the cache.
Yep.
> My idea is, get what you need and cache what you
> usually use. for example, in the sitemap:
> <map:match pattern="longlist">
> <map:action type="pagination">
> <map:parameter name="item-per-page" value="20">
>
> <map:generate type="sql" src="select * from emp
> limit {starting-row}, {item-per-page}"/>
> ....
> if i have oracle database, i will write:
> <map:generate type="sql" src="select * from
> (select * from (select * from (select * from emp order
> by empno) e where rowid < {item-per-page-x-pageid}) f
> order by empno desc) g where rowid <
> {item-per-page}"/>
>
> (although it is a bit complicated, but if i
> usually get only 0.1% of my result in the first 3
> pages, it should be worthy)
OK, granted. In my opinion, this caching should be done in the jdbc
layer or at least a seperate component, though. I thought there has
been announced some framework for that but I couldn't find it again.
Anyway, have a look at
http://www.geocities.com/sundar_rajan_in/java/servlets/databasecaching.html
it looks like J2EE or jdk1.4 does have some provisions for that.
> would it be hard if i have the page break in the
> middle of a month? however, if i do the paginate
> calculation before generate, i know exactly how many
> row will be in the result.
To be honest, I have never used the pagination transformer and after
having a short look at it, it seems, well, underdocumented.
> I don't know if I have any mis-understanding in the
> pagination in scratchpad (no doc at all X-p), but I am
> quite sure that filtertransformer is good only when
> all pages are frequently used.
Cached items time out. I don't know enough about the cache system to
say whether all cached items from one invocation of the
FilterTransformer time out together or if more frequent items survive
longer. Carsten?
Chris.
--
C h r i s t i a n H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>