PerThread service unique?
Hi all, I have a service that is marked with @Scope(ScopeConstants.PERTHREAD). Can I assume that there will be just *one* instance of this service per thread or there may be multiple instances?. I was under the impression that this service will be unique per thread but am facing a problem that might be explained if there are multiple instances of it. Any pointers to the documentation will be appreciated. My reading of http://tapestry.apache.org/defining-tapestry-ioc-services.html suggests me that there will be just one instance but wanted to be sure. Regards, Manuel.
Re: PerThread service unique?
On Mon, 30 Apr 2012 13:15:22 -0300, Manuel Sugawara manuel.sugaw...@gmail.com wrote: Hi all, Hi! I have a service that is marked with @Scope(ScopeConstants.PERTHREAD). Can I assume that there will be just *one* instance of this service per thread or there may be multiple instances?. One per thread (maybe zero, if it ends up not being used in a given thread). If you take a look at them in a debugger, the injected service object may look like there's a single shared instance, but actually it acts as a proxy and delegates method calls to the appropriate service instance for that thread. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: PerThread service unique?
On Mon, Apr 30, 2012 at 11:32 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: One per thread (maybe zero, if it ends up not being used in a given thread). If you take a look at them in a debugger, the injected service object may look like there's a single shared instance, but actually it acts as a proxy and delegates method calls to the appropriate service instance for that thread. I was trying to explain the symptoms with a colleague and all the sudden I learnt where the problem was, and of course, It was not tapestry. Sorry about the noise Regards, Manuel.