tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Re: ServiceBuilderMethodInvoker & @Autobuild
Date Fri, 02 Dec 2011 00:43:53 GMT
I've already committed fixes to trunk and 5.3.1.

On Thu, Dec 1, 2011 at 6:45 AM, Igor Drobiazko <igor.drobiazko@gmail.com> wrote:
> As reported by Denis in
> https://issues.apache.org/jira/browse/TAP5-1765 per-thread
> service builder method don't play well with parameters that are marked with
> @Autobuild annotation.
>
> The reason is that the method invocation plan for a service builder method
> is created only once and stored. Also the method parameters are calculated
> only once. This fact doesn't play well in a situation like this.
>
>
>    @Scope(ScopeConstants.PERTHREAD)
>    public static StringHolder buildStringHolder(@Autobuild
> StringHolderImpl holder)
>    {
>        return holder;
>    }
>
> In the example above the plan of for the service builder method is invoked
> for every new request, but because the same plan is reused again and again,
> same StringHolderImpl is used as method parameter. The consequence is that
> a per-thread service acts as a singleton.
>
> My suggestion is to rebuild the plan for a service builder method if at
> least one of the parameter is annotated with @Autobuild.
>
> Any objections?
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Mime
View raw message