You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "B.S.Navin" <bs...@effigent.net> on 2006/09/28 08:38:12 UTC

@Persist("session") does not make the accessor fetch from session everytime

Hi,

I was going through the Persistence mechanism implementations in  
Tapestry 4.0.2 and came across the following behaviour:

----------------------
For properties marked as @Persist("session"), the mutator(setter)  
stores the value in a instance variable and also puts it into session  
using the corresponding persistence strategy. But the accessor 
(getter) just fetches the value stored in the instance variable and  
does not check for an updated value within the session.
----------------------

This entire approach works fine until we start getting multiple  
simultaneous requests within the same session (which is possible when  
using asynchronous requests).

Here's a sample scenario where the above approach may cause a problem:

----------------------
Assume that 2 asynchronous requests (say 2 lookups) are running of  
the same page (same page class, but 2 different instances),  
simultaneously.

If Request#1 updates an @Persist("session") property value, Request#2  
will not see this updated value as the accessor of that property.
----------------------

Is what I have mentioned here right? Or is there something in the  
code that escaped my notice?

- Navin


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


Re: @Persist("session") does not make the accessor fetch from session everytime

Posted by "B.S.Navin" <bs...@effigent.net>.
JIRA created - https://issues.apache.org/jira/browse/TAPESTRY-1101

On 29-Sep-06, at 6:55 AM, Jesse Kuhnert wrote:

> That sounds like a bug in "theory" to me.. If you log it in JIRA I  
> might try
> and look at it while I'm looking at the other concurrency related  
> items.
> (maybe I'll poke Howard real quick about it too, sounds like a  
> delicate area
> to mess with ;) )
>
> On 9/28/06, B.S.Navin <bs...@effigent.net> wrote:
>>
>> Hi,
>>
>> I was going through the Persistence mechanism implementations in
>> Tapestry 4.0.2 and came across the following behaviour:
>>
>> ----------------------
>> For properties marked as @Persist("session"), the mutator(setter)
>> stores the value in a instance variable and also puts it into session
>> using the corresponding persistence strategy. But the accessor
>> (getter) just fetches the value stored in the instance variable and
>> does not check for an updated value within the session.
>> ----------------------
>>
>> This entire approach works fine until we start getting multiple
>> simultaneous requests within the same session (which is possible when
>> using asynchronous requests).
>>
>> Here's a sample scenario where the above approach may cause a  
>> problem:
>>
>> ----------------------
>> Assume that 2 asynchronous requests (say 2 lookups) are running of
>> the same page (same page class, but 2 different instances),
>> simultaneously.
>>
>> If Request#1 updates an @Persist("session") property value, Request#2
>> will not see this updated value as the accessor of that property.
>> ----------------------
>>
>> Is what I have mentioned here right? Or is there something in the
>> code that escaped my notice?
>>
>> - Navin
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> -- 
> Jesse Kuhnert
> Tapestry/Dojo/(and a dash of TestNG), team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


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


Re: @Persist("session") does not make the accessor fetch from session everytime

Posted by Jesse Kuhnert <jk...@gmail.com>.
That sounds like a bug in "theory" to me.. If you log it in JIRA I might try
and look at it while I'm looking at the other concurrency related items.
(maybe I'll poke Howard real quick about it too, sounds like a delicate area
to mess with ;) )

On 9/28/06, B.S.Navin <bs...@effigent.net> wrote:
>
> Hi,
>
> I was going through the Persistence mechanism implementations in
> Tapestry 4.0.2 and came across the following behaviour:
>
> ----------------------
> For properties marked as @Persist("session"), the mutator(setter)
> stores the value in a instance variable and also puts it into session
> using the corresponding persistence strategy. But the accessor
> (getter) just fetches the value stored in the instance variable and
> does not check for an updated value within the session.
> ----------------------
>
> This entire approach works fine until we start getting multiple
> simultaneous requests within the same session (which is possible when
> using asynchronous requests).
>
> Here's a sample scenario where the above approach may cause a problem:
>
> ----------------------
> Assume that 2 asynchronous requests (say 2 lookups) are running of
> the same page (same page class, but 2 different instances),
> simultaneously.
>
> If Request#1 updates an @Persist("session") property value, Request#2
> will not see this updated value as the accessor of that property.
> ----------------------
>
> Is what I have mentioned here right? Or is there something in the
> code that escaped my notice?
>
> - Navin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com