Just for info, I've found a nice project "Castle contrib" that contains
several "hybrid" scope accessor (and is actively maintained and updated for
Castle 3)

https://github.com/castleprojectcontrib/Castle.Windsor.Lifestyles/tree/master/Castle.Windsor.Lifestyles




On Fri, May 18, 2012 at 1:36 PM, Craig Neuwirt <[email protected]> wrote:

>
> On May 17, 2012, at 4:29 PM, Fabrice wrote:
>
>
>> Since in that scenario, their is no well defined scope boundary, I just
>> picked thread static since your data access component cannot be shared on a
>> thread.  You can obtain the scope any way you like.  Again, the problem is
>> that scope will never be disposed so if you component has lifecycle
>> concerns (disposable), they wont be called
>>
>
> But when using Transient, the component is correctly disposed ? If I
> correctly understood the Transient lifestyle, Castle doesn't keep a
> reference to the created object so this object is disposed when GC run,
> isn't ?
>
>
> Not quite, if you're a Transient and have lifecycle concerns (IDisposable)
> the container will track you so when you call Release it can execute those
> concerns.   Since you don't have access to container in your component, you
> will not be able to call Release so it will be a leak.
>
>
> There is no way to achieve the same behaviour here ?
>
> --
> 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.
>
>
>  --
> 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.
>

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