You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Daniel Ridings <ri...@holding.gu.se> on 2000/05/15 09:47:47 UTC
Life cycle of a producer
One of the major advantages of Java Servlets over the CGI approach is that
a servlet lives on. It is started once and from then on it can handle
requests rapidly, since it lives on.
The servlet I want to convert to a producer has some code that takes a
fair amount of time (approx 40 sec) to initiate some variables (word
frequency list for a language (Swedish in my case), a list of about
400,000 words with their absolute and relative frequencies).
Now, if I convert this same servlet to a producer, does that code
necessarily have to be invoked every time the producer is called into
action? The table of word frequencies is used _intensively_ in the servlet
logic, so storing it in a database isn't a solution. Database access is
just too slow.
Thanks for any tips here.
Daniel Ridings