You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kris Rasmussen <kr...@yahoo.com> on 2004/03/25 06:16:51 UTC

Stale link only when running two sessions at once, why?

I have a page that allows you to search for customers, then it display the results in a custom table component that I wrote. Once the results are displayed you can check which ones you wish to processes and click process. It all works fine until I open up two sessions and access the site. If in one session I search with one parameter and then in the other session I search with a different parameter(thus the displayed results are different) and then I try to process some of the results from the first session(by checking some of the results and clicking process) I get a stale link error thats says the following:
 
Rewind of form Manage_Customers/listForm expected allocated id #4 to be '$Checkbox$2', but was 'checkAll' (requested by component Manage_Customers/checkAll). 
 
This does not happen if in the second session I search with the same parameter, so obviously the search in the second session is somehow influencing the form/table results in the new session, but why?
 
I realize that the two sessions are probably sharing the same page from the page pool but I can't see how this could cause this error.
 
Thanks,
Kris
 
 


---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

RE: Stale link only when running two sessions at once, why?

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

I would recommend using ListEdit and FormConditional in your case -- it
seems like they do exactly what you need, since they store the data in the
form and make it kind of semi-persistent that way without burdening the
session.

Do they help?


-----Original Message-----
From: Kris Rasmussen [mailto:kristapestry@yahoo.com]
Sent: Thursday, March 25, 2004 12:47 PM
To: Tapestry users
Subject: Re: Stale link only when running two sessions at once, why?


Thanks. The problem actually was that the table component I wrote only
retrieved the rows when the page was rendering and not when it was
rewinding. So while the correct binding was enforced, the data that was
cached in the table component was not. Thus the page would render with x
number of rows and thus x number of checkbox's, and then the next session
would render the same page with y rows and y checkbox's. So when the first
page was rewound the form would not be the same.

Rather than making the sql call to populate the table when the form is
rewinding, is there another way to make the state of the form persistent? I
could make the cached table results persistent in the table component, but
that would take up memory and I don't want them to stay after leaving the
page and coming back.

Thanks,
Kris

Mindbridge <mi...@yahoo.com> wrote:
Do you happen to have a property in the page that is not initialized? This
is the most common cause of problems like these. If you define the
properties in the JWC, rather than in the Java code only, Tapestry will make
sure to initialize them between requests and hence dependency between
sessions will not be possible.

The other suggestion could be to use ListEdit instead of Foreach and
FormConditional (in contrib) rather than Conditional in the form. This will
make sure that the Form is rewinded in exactly the same way as it was
rendered and will possibly avoid StaleLink exceptions.

In any case, initialization of properties is probably the cause of the
problem and should be fixed, although using the Form-specific components
will probably make things look good as well, although they will not fix the
core of the issue.

----- Original Message -----
From: "Kris Rasmussen"
To:
Sent: Thursday, March 25, 2004 7:16 AM
Subject: Stale link only when running two sessions at once, why?


> I have a page that allows you to search for customers, then it display the
results in a custom table component that I wrote. Once the results are
displayed you can check which ones you wish to processes and click process.
It all works fine until I open up two sessions and access the site. If in
one session I search with one parameter and then in the other session I
search with a different parameter(thus the displayed results are different)
and then I try to process some of the results from the first session(by
checking some of the results and clicking process) I get a stale link error
thats says the following:
>
> Rewind of form Manage_Customers/listForm expected allocated id #4 to be
'$Checkbox$2', but was 'checkAll' (requested by component
Manage_Customers/checkAll).
>
> This does not happen if in the second session I search with the same
parameter, so obviously the search in the second session is somehow
influencing the form/table results in the new session, but why?
>
> I realize that the two sessions are probably sharing the same page from
the page pool but I can't see how this could cause this error.
>
> Thanks,
> Kris
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


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


---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.


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


Re: Stale link only when running two sessions at once, why?

Posted by Kris Rasmussen <kr...@yahoo.com>.
Thanks. The problem actually was that the table component I wrote only retrieved the rows when the page was rendering and not when it was rewinding. So while the correct binding was enforced, the data that was cached in the table component was not. Thus the page would render with x number of rows and thus x number of checkbox's, and then the next session would render the same page with y rows and y checkbox's. So when the first page was rewound the form would not be the same.
 
Rather than making the sql call to populate the table when the form is rewinding, is there another way to make the state of the form persistent? I could make the cached table results persistent in the table component, but that would take up memory and I don't want them to stay after leaving the page and coming back.
 
Thanks,
Kris

Mindbridge <mi...@yahoo.com> wrote:
Do you happen to have a property in the page that is not initialized? This
is the most common cause of problems like these. If you define the
properties in the JWC, rather than in the Java code only, Tapestry will make
sure to initialize them between requests and hence dependency between
sessions will not be possible.

The other suggestion could be to use ListEdit instead of Foreach and
FormConditional (in contrib) rather than Conditional in the form. This will
make sure that the Form is rewinded in exactly the same way as it was
rendered and will possibly avoid StaleLink exceptions.

In any case, initialization of properties is probably the cause of the
problem and should be fixed, although using the Form-specific components
will probably make things look good as well, although they will not fix the
core of the issue.

----- Original Message ----- 
From: "Kris Rasmussen" 
To: 
Sent: Thursday, March 25, 2004 7:16 AM
Subject: Stale link only when running two sessions at once, why?


> I have a page that allows you to search for customers, then it display the
results in a custom table component that I wrote. Once the results are
displayed you can check which ones you wish to processes and click process.
It all works fine until I open up two sessions and access the site. If in
one session I search with one parameter and then in the other session I
search with a different parameter(thus the displayed results are different)
and then I try to process some of the results from the first session(by
checking some of the results and clicking process) I get a stale link error
thats says the following:
>
> Rewind of form Manage_Customers/listForm expected allocated id #4 to be
'$Checkbox$2', but was 'checkAll' (requested by component
Manage_Customers/checkAll).
>
> This does not happen if in the second session I search with the same
parameter, so obviously the search in the second session is somehow
influencing the form/table results in the new session, but why?
>
> I realize that the two sessions are probably sharing the same page from
the page pool but I can't see how this could cause this error.
>
> Thanks,
> Kris
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


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


---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: Stale link only when running two sessions at once, why?

Posted by Mindbridge <mi...@yahoo.com>.
Do you happen to have a property in the page that is not initialized? This
is the most common cause of problems like these. If you define the
properties in the JWC, rather than in the Java code only, Tapestry will make
sure to initialize them between requests and hence dependency between
sessions will not be possible.

The other suggestion could be to use ListEdit instead of Foreach and
FormConditional (in contrib) rather than Conditional in the form. This will
make sure that the Form is rewinded in exactly the same way as it was
rendered and will possibly avoid StaleLink exceptions.

In any case, initialization of properties is probably the cause of the
problem and should be fixed, although using the Form-specific components
will probably make things look good as well, although they will not fix the
core of the issue.

----- Original Message ----- 
From: "Kris Rasmussen" <kr...@yahoo.com>
To: <ta...@jakarta.apache.org>
Sent: Thursday, March 25, 2004 7:16 AM
Subject: Stale link only when running two sessions at once, why?


> I have a page that allows you to search for customers, then it display the
results in a custom table component that I wrote. Once the results are
displayed you can check which ones you wish to processes and click process.
It all works fine until I open up two sessions and access the site. If in
one session I search with one parameter and then in the other session I
search with a different parameter(thus the displayed results are different)
and then I try to process some of the results from the first session(by
checking some of the results and clicking process) I get a stale link error
thats says the following:
>
> Rewind of form Manage_Customers/listForm expected allocated id #4 to be
'$Checkbox$2', but was 'checkAll' (requested by component
Manage_Customers/checkAll).
>
> This does not happen if in the second session I search with the same
parameter, so obviously the search in the second session is somehow
influencing the form/table results in the new session, but why?
>
> I realize that the two sessions are probably sharing the same page from
the page pool but I can't see how this could cause this error.
>
> Thanks,
> Kris
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


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


Re: Stale link only when running two sessions at once, why (more)?

Posted by Kris Rasmussen <kr...@yahoo.com>.
I forgot to mention that the table component takes a "where" parameter to supply to a sql call, and in the problem page it is bound to a property in a custom form component that has hashtables for its fields. I suspect this is the problem.
 
If I am write (correct me if I'm not ;) then this shows how confusing tapestry can be sometimes. Without a rock solid idea of how ever bit of it works, you run into a lot of trouble. Maybe better documentation would help, but I think more can be done to make it easier to use.
 
Kris

Kris Rasmussen <kr...@yahoo.com> wrote:
I have a page that allows you to search for customers, then it display the results in a custom table component that I wrote. Once the results are displayed you can check which ones you wish to processes and click process. It all works fine until I open up two sessions and access the site. If in one session I search with one parameter and then in the other session I search with a different parameter(thus the displayed results are different) and then I try to process some of the results from the first session(by checking some of the results and clicking process) I get a stale link error thats says the following:

Rewind of form Manage_Customers/listForm expected allocated id #4 to be '$Checkbox$2', but was 'checkAll' (requested by component Manage_Customers/checkAll). 

This does not happen if in the second session I search with the same parameter, so obviously the search in the second session is somehow influencing the form/table results in the new session, but why?

I realize that the two sessions are probably sharing the same page from the page pool but I can't see how this could cause this error.

Thanks,
Kris




---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.