You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mircea Romantan <mi...@recognos.ro> on 2004/02/17 01:20:51 UTC

Urgent help needed !

Hi everyone
seems we've run into another issue.
We are using tapestry with
-Dorg.apache.tapestry.disable-caching=false,
for speed reasons.
We just recently discovered that on pages that have dynamic form 
controls, we get stale links.
Here is the scenario :

1. Consider having page A that lets you edit some stuff in the database.
2. User X logs in, gets to that page and his profile says that page A 
should only display 1 TextField
3. User Y  logs in, gets to that page and his profile says that page A 
should  display 2 TextFields.
The problem is that is both users are on the same page, the first one to 
get to that page will get a StaleLink exception.

Also, suppose that  the object that sets the value of these TextFields 
is NOT Serializable.

How can I handle that ? Is there a quick fix  to this solution?
Any suggestions are welcome.

In our case, enabling tapestry caching and having concurrent users onto 
a page that has some dynamic information to submit is causing serious 
issues to the point of project failure.


-- 

Mircea Romantan
Software Engineer
Recognos Romania 

www.recognos.ro
www.recognos.com





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


RE: Urgent help needed !

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I think he's on the right track there.

Make sure you are using <property-specification> for your properties ... this ensures correct
end-of-request cleanup.

Be careful with loops and conditionals inside forms: use ListEdit instead of Foreach, nd
FormConditional instead of Conditional.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: Marilen Corciovei [mailto:len@nemesisit.rdsnet.ro] 
> Sent: Monday, February 16, 2004 8:02 PM
> To: Tapestry users
> Cc: mircear@recognos.ro
> Subject: Re: Urgent help needed !
> 
> 
> As I previously told you on a similar question your problem 
> is probably
> the result of the fact that your page is rendered based on 
> the value of
> a variable which is not cleaned on detach. After the page is rendered
> for the first user the page object and inherently your variable are
> stored in the cache but when the second user gets there the 
> object from
> the cache is innapropriate for it's use. This is a common 
> mistake I have
> seen in my team. When running without a cache this problem does not
> appear since everything is recreated each time. The solution 
> consist in
> cleaning all variables in detach and storing the user specific as a
> persistent property (will get stored in user session). If, as I guess,
> your problem is that you have an active db connection which is not
> serializable you can use some pooling mechanism, if the
> non-serialization comes from another reason then you will 
> have to store
> some user-specific data and recreate the object each time.
> 
> len 
>  
> On Tue, 2004-02-17 at 02:20, Mircea Romantan wrote:
> 
> > Hi everyone
> > seems we've run into another issue.
> > We are using tapestry with
> > -Dorg.apache.tapestry.disable-caching=false,
> > for speed reasons.
> > We just recently discovered that on pages that have dynamic form 
> > controls, we get stale links.
> > Here is the scenario :
> > 
> > 1. Consider having page A that lets you edit some stuff in 
> the database.
> > 2. User X logs in, gets to that page and his profile says 
> that page A 
> > should only display 1 TextField
> > 3. User Y  logs in, gets to that page and his profile says 
> that page A 
> > should  display 2 TextFields.
> > The problem is that is both users are on the same page, the 
> first one to 
> > get to that page will get a StaleLink exception.
> > 
> > Also, suppose that  the object that sets the value of these 
> TextFields 
> > is NOT Serializable.
> > 
> > How can I handle that ? Is there a quick fix  to this solution?
> > Any suggestions are welcome.
> > 
> > In our case, enabling tapestry caching and having 
> concurrent users onto 
> > a page that has some dynamic information to submit is 
> causing serious 
> > issues to the point of project failure.
> > 
> 


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


Re: Urgent help needed !

Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
As I previously told you on a similar question your problem is probably
the result of the fact that your page is rendered based on the value of
a variable which is not cleaned on detach. After the page is rendered
for the first user the page object and inherently your variable are
stored in the cache but when the second user gets there the object from
the cache is innapropriate for it's use. This is a common mistake I have
seen in my team. When running without a cache this problem does not
appear since everything is recreated each time. The solution consist in
cleaning all variables in detach and storing the user specific as a
persistent property (will get stored in user session). If, as I guess,
your problem is that you have an active db connection which is not
serializable you can use some pooling mechanism, if the
non-serialization comes from another reason then you will have to store
some user-specific data and recreate the object each time.

len 
 
On Tue, 2004-02-17 at 02:20, Mircea Romantan wrote:

> Hi everyone
> seems we've run into another issue.
> We are using tapestry with
> -Dorg.apache.tapestry.disable-caching=false,
> for speed reasons.
> We just recently discovered that on pages that have dynamic form 
> controls, we get stale links.
> Here is the scenario :
> 
> 1. Consider having page A that lets you edit some stuff in the database.
> 2. User X logs in, gets to that page and his profile says that page A 
> should only display 1 TextField
> 3. User Y  logs in, gets to that page and his profile says that page A 
> should  display 2 TextFields.
> The problem is that is both users are on the same page, the first one to 
> get to that page will get a StaleLink exception.
> 
> Also, suppose that  the object that sets the value of these TextFields 
> is NOT Serializable.
> 
> How can I handle that ? Is there a quick fix  to this solution?
> Any suggestions are welcome.
> 
> In our case, enabling tapestry caching and having concurrent users onto 
> a page that has some dynamic information to submit is causing serious 
> issues to the point of project failure.
>