You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Amit Gupta <am...@FXALL.com> on 2005/03/17 01:43:52 UTC

Stale Link Exception

Hi,

I I am working on a Tapestry code.

We have one application running based on the Tapestry framework. We are getting Stalelink exception while trying out the following stuff: 
We have two browser instances open. We have used dropdown and checkboxes. In one instance a checkbox appears which displays the state as 'Pending'.
 In another instance we have changed the selection from 'Pending' to 'Approved' and submitted the form. 
The state is changed to 'Approved' in the database. Now we go back to the first instance , checked the checkbox against 'Pending' and clicked 'Submit'. 
Now what is happening is that we are trying to save 'Pending' state in one instance that had already been changed to 'Approved' in the other instance. 
So the page having 'Pending' state throws a stale link excpetion. 

Our requirement is to to display the message in the first instance saying that "data has already been modified" and to refresh the page with new data.

So I have replaced @foreach with @ListEdit. So in order to display the message I am using two ArrayLists of the objects conataing data to be compared.  I used arraylist to store the old and new data.

I am comparing the data of lists in formSubmit(). I am setting the message "data has already been modified"  , in visit object if the data in the two arraylists is different.

Whenever I Submit the form in the first instance, I am getting exception at the line where I am getting session as follows :

CustomerAdminUserSession cas = (CustomerAdminUserSession) visit.getCurrentSession();

I am not able to get the session. Is this has to do something with the way I have used arraylist in my code??

I have declared List as  

private AccountProvider[] list1; //old list
private AccountProvider[] list2; //new list

I am storing the data in these list in pageRender() method and comparing them in formSubmit().

I am using following softwares :

 Tapestry 3.0
 JSDK 1.4
 Tomacat 5.0

Also, Is there any other workaround for foreach instead of LisEdit as we have used @foreach everywhere?

I appreciate your help. 

Thanks,
Amit





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