Ooops; meant to copy this to the list:

-----Forwarded Message-----
From: Jason Hildebrand <[EMAIL PROTECTED]>
To: Olivier Migeon <[EMAIL PROTECTED]>
Subject: Re: [Webware-discuss] class variables not persistent across requests ?
Date: Wed, 22 Sep 2004 17:42:17 -0500

On Wed, 2004-09-22 at 16:19, Olivier Migeon wrote:
> I'm creating a page containing a form including a <select> field
> which
> <options> values are filled from a database query. I would like to
> cache the result of the query, in order to make the query only once,
> and therefore speed up the rendering. I really mean once, not once
> per session.

> So, my questions are :

> 1) why doesn't it work? It's not a caching issue because my
> CacheServletClasses is set to 0 in my Application.config file.

If CacheServletClasses is set to 0, then WebKit will reload the servlet
module (which contains the servlet class) on each request, wiping out your
cache.
Normally I use CacheServletClasses = 1 and CacheServletInstances = 1 -- is
there
a reason that you don't want to do this?

> 2) what is the best way to make persistent variables accross requests

I use CacheServletInstances = 1, and cache such results directly in the
servlet instance.  If there are multiple simultaneous requests for the same
page
WebKit may create additional instances of the servlet to process the
requests more quickly, but the result will be calculated once for each
servlet instance, which is normally acceptable.

--
Jason D. Hildebrand
T: 204 775 1212
E: [EMAIL PROTECTED]
--
Jason D. Hildebrand
T: 204 775 1212
E: [EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to