You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jose Gonzalez Gomez <jg...@gmail.com> on 2004/12/23 18:59:12 UTC
Page pooling, persistent properties,...
Hi there,
I have some doubts about page pooling and persistent properties, and I
have found contradictory answers in the list. I have tried to access
the same page from two machines, and from two browsers in the same
machine, and I have found the following:
1. The requests were served at different non overlapping times, but
they were served by two different instances of the page (checked using
a debugger and the object id of the debugger)
2. The requests for the same user, even if two browsers showed the
same page, were served by the same page instance.
3. A declared (specified in page or component specification) non
persistent property is set to null between different requests
4. A declared persistent property keeps its value between different requests
5. A non declared property (an instance variable plus getter/setter
methods) keeps its value between different requests
Taking all of this into account I have made the following assumptions,
am I right?
1. Tapestry uses an instance of the page for each session (so there
are no clashes on persistent properties among different users, but
there may be clashes if the same user/session opens the same page
twice). What's the use of the pool in this case?
2. Tapestry sets to null all known properties (parameters, specified
properties,...) between requests except persistent properties, leaving
their values unchanged
3. Tapestry don't do anything about unknown properties (instance
variables plus getter/setter), so they keep their values, achieving
the same effect that using persistent properties
Now some questions,
1. Is point 1 correct, or maybe we had a great luck? If Tapestry uses
a pool common for all users, I guess there must be some limit in the
number of instances created...
2. In case page instances are shared, which is the correct way to
handle persistent properties? Are persistent properties stored and
retrieved in the session (or engine) so they aren't shared by the same
user? Is a page containing persistent properties stored in the session
(or engine)?
3. Is the same to use a persistent property specified in the
page/component specification and to use a non declared property
(instance variable + getter/setter)?
I hope this, and of course the answers, can help me and other people
to better understand page pooling and persistent properties
management.
Thanks in advance, best regards
Jose
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Page pooling, persistent properties,...
Posted by "Julio C. Rivera" <ju...@ya.com>.
The answers to your questions are in the Tapestry Documentation. Please,
see
http://jakarta.apache.org/tapestry/doc/DevelopersGuide/pages.persistent-state.html
http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/state.page-properties.html
http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/state.manual-page-properties.html
Short answers to your questions (please, correct me if I'm in error):
Q: 1. Is point 1 correct, or maybe we had a great luck? ..."
A: Yes, you had a great luck :-). The pool is shared by all users.
Q: 2. In case page instances are shared, which is the correct way to
handle persistent properties? Are persistent properties stored and
retrieved in the session (or engine) so they aren't shared by the same
user? Is a page containing persistent properties stored in the session
(or engine)?
A: Persistent properties are stored in the HttpSession. When a page is
retrieved from the pool, it's persistent properties are retrieved from
the HttpSession and setted in the page.
Q: 3. Is the same to use a persistent property specified in the
page/component specification and to use a non declared property
(instance variable + getter/setter)?
A: A non declared property is not the same than a persistent property.
Please, read the tapestry documentation (see links above) and think
about it.
Sorry for my bad english. I can explain better using my mother language
(spanish).
Best regards,
Julio.
El jue, 23-12-2004 a las 18:59, Jose Gonzalez Gomez escribió:
> Hi there,
>
> I have some doubts about page pooling and persistent properties, and I
> have found contradictory answers in the list. I have tried to access
> the same page from two machines, and from two browsers in the same
> machine, and I have found the following:
>
> 1. The requests were served at different non overlapping times, but
> they were served by two different instances of the page (checked using
> a debugger and the object id of the debugger)
> 2. The requests for the same user, even if two browsers showed the
> same page, were served by the same page instance.
> 3. A declared (specified in page or component specification) non
> persistent property is set to null between different requests
> 4. A declared persistent property keeps its value between different
requests
> 5. A non declared property (an instance variable plus getter/setter
> methods) keeps its value between different requests
>
> Taking all of this into account I have made the following assumptions,
> am I right?
>
> 1. Tapestry uses an instance of the page for each session (so there
> are no clashes on persistent properties among different users, but
> there may be clashes if the same user/session opens the same page
> twice). What's the use of the pool in this case?
> 2. Tapestry sets to null all known properties (parameters, specified
> properties,...) between requests except persistent properties, leaving
> their values unchanged
> 3. Tapestry don't do anything about unknown properties (instance
> variables plus getter/setter), so they keep their values, achieving
> the same effect that using persistent properties
>
> Now some questions,
>
> 1. Is point 1 correct, or maybe we had a great luck? If Tapestry uses
> a pool common for all users, I guess there must be some limit in the
> number of instances created...
> 2. In case page instances are shared, which is the correct way to
> handle persistent properties? Are persistent properties stored and
> retrieved in the session (or engine) so they aren't shared by the same
> user? Is a page containing persistent properties stored in the session
> (or engine)?
> 3. Is the same to use a persistent property specified in the
> page/component specification and to use a non declared property
> (instance variable + getter/setter)?
>
> I hope this, and of course the answers, can help me and other people
> to better understand page pooling and persistent properties
> management.
>
> Thanks in advance, best regards
> Jose
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org