I meant Application_EndRequest that I put in my application class.

Problem solved anyway. Cheated windsor :)

public class DropDisposalConcern<T> : FactoryMethodActivator<T>
{
        public DropDisposalConcern(ComponentModel model, IKernel kernel,
ComponentInstanceDelegate onCreation, ComponentInstanceDelegate
onDestruction) : base(model, kernel, onCreation, onDestruction)
        {
        }

        protected override void ApplyDecommissionConcerns(object instance)
        {
                instance = ProxyUtil.GetUnproxiedInstance(instance);
                ApplyConcerns(Model.Lifecycle.DecommissionConcerns.Where(x => 
!(x is
DisposalConcern)), instance);
        }
}

Component.For<ISession>().UsingFactoryMethod(ResolveSession).LifeStyle.Transient.Activator<DropDisposalConcern<ISession>>().OverWrite()

How cheaty is that? :)

On 21 сен, 21:15, Vadimmer <[email protected]> wrote:
> I also thought of it. Will it run before Application_EndRequest?
> I wanted it to be very clear that session disposal is covered by
> Application_EndRequest.
>
> Is there any way to tell windsor to release component without calling
> Dispose?
>
> On 21 сен, 21:06, Krzysztof Koźmic <[email protected]> wrote:
>
>
>
> > Make it PerWebRequest, not transient.
>
> > 2010/9/22 Vadimmer <[email protected]>
>
> > > Hi,
> > > I'm using UsingFactoryMethod +Lifestyle.Transient to resolve NH
> > > session from the container (before this issue
>
> > >http://stackoverflow.com/questions/3698164/castle-windsor-isubdepende...
> > > i used subdependencyresolver).
>
> > > The problem is that my session disposal is managed by begin/end
> > > request. Windsor release policy interferes and disposes the session
> > > before the end of request.
>
> > > Can I somehow tell the container to use NoTracking policy for one
> > > component (ISession)?
>
> > > Thanks,
> > > Vadim
>
> > > //Full story just in case
> > > My outer controller depends on ISession. In view I have RenderAction
> > > calling other controller. After the first controller is done, session
> > > gets disposed by mistake. Second controller receives a session that is
> > > closed. BOOM.
>
> > > --
> > > 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]<castle-project-users%2bun­­[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/castle-project-users?hl=en.

-- 
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.

Reply via email to