You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by carlos f <ca...@yahoo.com> on 2007/11/16 22:55:25 UTC

OGNL Expression evaluated 4 times on tap 4.1.2 release

Tap 4.1.2 release
tapestry-test 5.0.5
selenium 0.8.1 (with Jetty baked into Jar)

win xp pro sp/2
java 1.5.0_05

This occurs when i am executing tests as part of my selenium integration
tests.  I have not looked into how this behaves in a more typical deployment
environment.  As far as I can tell Jetty is running without the two
"development" options that I know of enabled (disable-caching and
enable-reset-service).

This has been mentioned on the board before as an issues with the 4.1.2
SNAPSHOT back in May/07 and the 4.1.3 SNAPSHOT in Sept/07. 

--> 
http://www.nabble.com/-Tap-4.1.2--Problem-with-repeated-calls-to-an-If-component-tf3772676.html#a10676029
--> 
http://www.nabble.com/OGNL-Methode-called-several-times-tf4488389.html#a13619568

The response to the "Problem-with-repeated-calls-to-an-If-component" thread
suggests that this will be fixed before the release of 4.1.2.

At least one other person has run across this using the 4.1.3 release.

--
http://www.nabble.com/-Tap-4.1.2--Problem-with-repeated-calls-to-an-If-component-tf3772676.html#a13551793

Is this a configuration/user error on my side, or is the framework still
purposefully evaluating these OGNL expressions 4 times?

Carlos
-- 
View this message in context: http://www.nabble.com/OGNL-Expression-evaluated-4-times-on-tap-4.1.2-release-tf4824162.html#a13802424
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: OGNL Expression evaluated 4 times on tap 4.1.2 release

Posted by carlos f <ca...@yahoo.com>.

andyhot wrote:
> 
> On the meantime, maybe the @Cached annotation can help you.
> http://tacos.sourceforge.net/tacos4.1/tacos-annotations/index.html
> It's in the 4.1.1-SNAPSHOT and it annotates a normal non-abstract method,
> caching its result and returning it on further invocations.
> 

Thanks for the suggestion.  That should work.

Carlos
-- 
View this message in context: http://www.nabble.com/OGNL-Expression-evaluated-4-times-on-tap-4.1.2-release-tf4824162.html#a13850119
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: OGNL Expression evaluated 4 times on tap 4.1.2 release

Posted by andyhot <an...@di.uoa.gr>.
Yep, it is on purpose - but I think that Jesse has said that it's 
supposed to
go away eventually...

On the meantime, maybe the @Cached annotation can help you.
http://tacos.sourceforge.net/tacos4.1/tacos-annotations/index.html
It's in the 4.1.1-SNAPSHOT and it annotates a normal non-abstract method,
caching its result and returning it on further invocations.

I originally wrote this to get away from all those null checks on abstract
properties... or the initializations on pageBeginRender - but it looks 
like it's
working for this situation as well !


carlos f wrote:
> carlos f wrote:
>   
>> This occurs when i am executing tests as part of my selenium integration
>> tests.
>>
>> . . . 
>>
>> Is this a configuration/user error on my side, or is the framework still
>> purposefully evaluating these OGNL expressions 4 times?
>>
>>     
>
> I am still looking into this, but it appears that is the way the framework
> is intended to operate.
>
> When an OGNL expression is first compiled, the underlying method the
> expression resolves to is invoked 3 times.  Subsequent calls to the ONGL
> Node the compilation process generates executes the underlying method an
> additional time.
>
> When running tapestry in a standard environment, each expression should only
> be compiled once and then added to the cache.  However, for non-idempotent
> methods a single expression compilation (and its 3 spurious invocations)
> will cause all sorts of hell.
>
> My integration tests, which spits up a Jetty container for each test run,
> never have the benefit of working with pre-compiled expressions.
>
> I am still trying to see if there is something I can do to avoid the 3
> initial calls.  Otherwise I am going to have to rethink a bit of
> functionality that seemed to work just fine with tap 4.0.x.
>
> Carlos
>   

-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


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


Re: OGNL Expression evaluated 4 times on tap 4.1.2 release

Posted by carlos f <ca...@yahoo.com>.

carlos f wrote:
> 
> This occurs when i am executing tests as part of my selenium integration
> tests.
> 
> . . . 
> 
> Is this a configuration/user error on my side, or is the framework still
> purposefully evaluating these OGNL expressions 4 times?
> 

I am still looking into this, but it appears that is the way the framework
is intended to operate.

When an OGNL expression is first compiled, the underlying method the
expression resolves to is invoked 3 times.  Subsequent calls to the ONGL
Node the compilation process generates executes the underlying method an
additional time.

When running tapestry in a standard environment, each expression should only
be compiled once and then added to the cache.  However, for non-idempotent
methods a single expression compilation (and its 3 spurious invocations)
will cause all sorts of hell.

My integration tests, which spits up a Jetty container for each test run,
never have the benefit of working with pre-compiled expressions.

I am still trying to see if there is something I can do to avoid the 3
initial calls.  Otherwise I am going to have to rethink a bit of
functionality that seemed to work just fine with tap 4.0.x.

Carlos
-- 
View this message in context: http://www.nabble.com/OGNL-Expression-evaluated-4-times-on-tap-4.1.2-release-tf4824162.html#a13844431
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: OGNL Expression evaluated 4 times on tap 4.1.2 release

Posted by Kalle Korhonen <ka...@gmail.com>.
Yes, I get this too on 4.1.3.

Kalle


On 11/19/07, carlos f <ca...@yahoo.com> wrote:
>
>
> BUMP . . . just trying to make sure this didn't get lost in all the T5
> messages over the weekend .
>
> Does anyone know what I can do to eliminate the duplicate calls?
>
> Thanks in advance.
>
> Carlos
> --
> View this message in context:
> http://www.nabble.com/OGNL-Expression-evaluated-4-times-on-tap-4.1.2-release-tf4824162.html#a13837518
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: OGNL Expression evaluated 4 times on tap 4.1.2 release

Posted by carlos f <ca...@yahoo.com>.
BUMP . . . just trying to make sure this didn't get lost in all the T5
messages over the weekend .

Does anyone know what I can do to eliminate the duplicate calls?

Thanks in advance.

Carlos
-- 
View this message in context: http://www.nabble.com/OGNL-Expression-evaluated-4-times-on-tap-4.1.2-release-tf4824162.html#a13837518
Sent from the Tapestry - User mailing list archive at Nabble.com.


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