spring provides a scoping mechanism and supports session scope out of the box. why dont you google around for that, might save you some headaches.
-igor On Fri, Jul 17, 2009 at 11:27 AM, Steve Tarlton<[email protected]> wrote: > My app is using Spring/Hibernate and I am using the @SpringBean annotation > based dependency injection to tie in my services. During my development, I > found I needed access to one of the services at the session layer and found > a thread that discussed how to do that by calling out > "InjectorHolder.getInjector().inject(this);" in the init when constructing > the session. > > Now I am wondering if it is more optimal to move all of my other service > lookup injectors to the session scope. To me, it seems that this would be > more optimal as the app would only need to inject the service once as > opposed to potentially many times if replicated within several components. > However, the trade-off may be holding service-level data at a session level, > thus sticking around for the life of the session. Is this a correct > analysis, or is it simply good practice to create injectors to services at > the session layer so that only one instance is ever created for a given > session? > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
