On Thu, 14 Nov 2013 18:57:24 -0200, George Christman
<gchrist...@cardaddy.com> wrote:
On Thu, Nov 14, 2013 at 3:45 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:
When your service has state (injected services doesn't count) which is
per thread.
Just to clarify, are you saying Injected services wouldn't work in a
PerThread Scope?
That's a different question and the answer is that they will work.
Services won't stop working because they're being injected in a service
with a given scope. Tapestry-IoC takes care of the scope and you can mix
and match perthread and singleton scopes without even blinking.
If your service has state and it (the state) should be the same for more
than one thread (in your case, the lock), it cannot be per thread,
otherwise you'd had one lock per thread, which would be useless in a
multithreaded scenario.
Also, considering the lock is a static member, it couldn't be shared
across threads?
Yep, but then it would make no sense for the service to be perthread, at
least not with the code you posted.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org