Re: EagerLoad service doesn't use PerThread service correctly

2008-07-29 Thread Howard Lewis Ship
I would subclass TapestryFilter; override init() to get the service and store it somewhere (i.e., a static variable somewhere). Override destroy() to clear out the static variable (to avoid memory leaks). On Tue, Jul 29, 2008 at 2:39 PM, Franz Amador <[EMAIL PROTECTED]> wrote: > > Thanks again.

Re: EagerLoad service doesn't use PerThread service correctly

2008-07-29 Thread Franz Amador
Thanks again. Putting the registry in the ServletContext looks right, but I'm not sure it's enough for my use case. I need access to the Hibernate session from deep in the bowels of my legacy ORM framework, and the ServletContext is not easily accessible from there. I may just be stuck with a s

Re: EagerLoad service doesn't use PerThread service correctly

2008-07-28 Thread Howard Lewis Ship
I went looking for the best way to do this, and didn't find anything I like. Certainly, avoiding static fields is a step in the right direction. I'm going to quickly implement https://issues.apache.org/jira/browse/TAPESTRY-2540 Once you have the Registry, you have the keys to the castle! On Fri

Re: EagerLoad service doesn't use PerThread service correctly

2008-07-25 Thread Franz Amador
Thanks, Howard. Splitting my per-thread service into interface and implementation did the trick. My intent, by the way, is to have all threads share the singleton eager-load service but for some of that service's behavior to be per-thread, provided by the per-thread service. This is an odd arra

Re: EagerLoad service doesn't use PerThread service correctly

2008-07-24 Thread Howard Lewis Ship
This looks like an issue ... I think EagerLoad is not compatible with non-singleton scopes. What does it mean to eager load a service that is, in fact, used in multiple threads? Ah, here's the issue; when you bind a class, not an interface, as a service, it automatically uses singleton scope. On

EagerLoad service doesn't use PerThread service correctly

2008-07-24 Thread Franz Amador
I have an EagerLoad service that uses a PerThread service. I expected the EagerLoad service to hold a reference to a proxy to the PerThread service so that the actual instance of the PerThread service that is used depends upon the thread calling the EagerLoad service. Instead, the EagerLoad serv