Re: Picking up .wo changes
Re: Picking up .wo changes
- Subject: Re: Picking up .wo changes
- From: Anders F Björklund <email@hidden>
- Date: Fri, 6 Jun 2003 08:41:49 +0200
Could you be a bit more explicit as to what you are trying to achieve.
It all started when I had modified a component and was looking for the
"reload definition"
method on the component... It seems that the current caching is either
never or forever.
I just thought it would have been nice if WebObjects could pick up
changes
in the templates (or in the java code or in the database) in an easy
manner...
I have two application running that reload the templates on the fly
one from the DB and one from the file system.
What is the benefit of loading templates from the database ?
(assuming that with "templates" you mean the .wo bundles)
They have a memory cache like WO but it is under the application
control and I can decide when and what to purge.
Ah, the missing cache control... Do you cache the HTML and WOD contents
too, or just the resulting WOElement ?
You want to use a cache as you do not want to reparse the components
all the time.
It even seems to be calling template() several times during one
request, so I think you're right there...
The one thing to be careful: Your cache must be thread safe.
If I ever want to enable "concurrent requests", you mean ?
Otherwise WebObjects would only be running a single request at a time
anyway, would it not ?
Something like this should do, should it not: (well, I have to load the
strings from somewhere too)
WOElement cachedTemplate;
public WOElement template()
{
if (cachedTemplate == null)
{
synchronized(cachedTemplate)
{
if (cachedTemplate == null)
cachedTemplate = templateWithHTMLString(htmlString, wodString,
languages);
}
}
return cachedTemplate;
}
Or perhaps I'll just forget about it all, and go back to PHP and MySQL
again...
At least there I can look at the source code, if I wonder about
something.
--anders
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.