Calling setAcessible on the same field from different threads is not 
thread-safe, but it's a special case, don't be affraid to use field injection.

Denis

Mar 20, 2012 v 1:49 PM, fmaylinch:

> 
> Denis Stepanov-2 wrote
>> 
>> Where did you read about fields injection not being thread safe? It's
>> definitely not true. Some developers like to use constructor injection
>> because of better testing etc. personally I'm using mostly field
>> injection.
>> 
> 
> Here: 
> http://tapestry.apache.org/defining-tapestry-ioc-services.html#DefiningTapestryIOCServices-FieldInjection
> Field Injection 
> 
> It says:
> 
> 
> 
>> Caution: injection via fields uses reflection to make the fields
>> accessible. In addition, it may not be as thread-safe as using the
>> constructor to assign to final fields.
>> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Why-not-setter-injection-or-thread-safe-field-Inject-tp5579388p5579927.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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

Reply via email to