Answered by Krzysztof on stackoverflow: http://stackoverflow.com/questions/1882839/castle-using-factory-method-and-transient-lifestyle
On Dec 10, 1:56 pm, beckelmw <[email protected]> wrote: > I have the following code in my application start method along with > the code to setup the container and factory support. The factory > method seems to only be called once instead of every time the session > is needed. > > _container.Kernel.Register( > Component.For<ISession>().LifeStyle.Transient > .UsingFactoryMethod(() => > { > if (HttpContext.Current.Items["session"] == > null) > HttpContext.Current.Items["session"] > =sessionFactory.OpenSession(); > return (ISession)HttpContext.Current.Items > ["session"]; > }); > > I was initially using build 1509, but updated to build 1548 with the > same result. Please let me know if you need more information to help > me. -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
