You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nick Westgate <ni...@key-planning.co.jp> on 2006/06/01 05:19:27 UTC

Re: List loaded twice from DB

Hi Mark.

Confusion over initial-value used to be a regular topic here for
Tapestry beginners, but bot so much now. Resetting the property to
null is the default behaviour, so there should be no need to do this.

As for the "attach-value" idea, I haven't seen it discussed, but I
suspect it may have to do with the order of property initialization,
the rewind cycle etc just making this easier to code in Java.

Try asking your question on the dev list.

Cheers,
Nick.


Mark wrote:
> Hi Nick, thanks for this response.
> 
> The next question is probably to be decided by the Tapestry developers, 
> but maybe somebody else has some insights on this or knows if this has 
> been discussed before:
> 
> Would it not make more sense to be able to specify a "attach-value" and 
> a "detach-value" instead of a "initial-value"?
> This way I could explicitly specify two different values for the two 
> points in time of the page's lifecycle. I could do:
> 
> <property name="myList" attach-value="ognl:service.loadListFromDb()" 
> detach-value="ognl:null"/>
> 
> The reason being that it doesn't seem to make much sense to perform 
> resource-expensive operations like DB queries for cleanup AFTER the page 
> is used. As far as I understand, this post-use initialization is mainly 
> done to prevent data that belongs to one user from being "accidentally" 
> carried over to the next user.
> So setting the property to null when the page is returned to the pool 
> should be enough for that purpose. Especially since by the time the next 
> user gets the page from the pool, the cached value might long be outdated.
> 
> On the other hand, this idea sounds too simple for it to never have come 
> up before, so maybe there is a good reason against it?!
> 
> Thanks,
> 
> MARK

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org