On May 17, 2012, at 10:15 AM, Fabrice wrote:

> I was just replying to my own message when I see your answer :-)
> 
> Indeed I just finished a test project and it only happend if the component is 
> resolved in the IAuthorizationPolicy (or I suppose also in the Validator). It 
> works fine if used in the operation method.
> Is it a bug ? do you want the test project ?

This is the expected behavior

> 
> In fact how could I configure the container so that some specific component 
> (the Validator) use Transient lifestyle, and all other use PerWcfOperation ? 
> I really need to use a PerWcfOperation to avoid db lock when several 
> component update the db. In this case, they all share the same connection, 
> otherwise (Transient) they all have a different connection and lock each 
> other.
> 
> Is it possible to create a custom lifestyle that try a PerWcfOperation and, 
> if it doesn't works, fall back on the Transient lifestyle ?

It is certainly possible to do that and off the top of my head, I believe the 
prior version did that.  As mentioned above, that is the wrong behavior since 
it would be inconsistent.
What I currently do is register the components with the general Scoped 
lifestyle and explicitly control the boundary of the scope.  The 
Container/Kernel has a BeginScope extension method which will start the scope 
and on disposal remove it.   I then put hooks in ASP.NET to begin the scope.    
 I use that option to control my data access as well.

> 
> Thank you for your help 
> Fabrice
> 
> 
> On Thu, May 17, 2012 at 5:07 PM, Craig Neuwirt <[email protected]> wrote:
> I don't believe an OperationContext.Current is available at the point where a 
> custom UserNamePasswordValidator is called.  This could be why no scope could 
> be obtained.  Is it possible to choose  a different lifestyle.
> 
> -craig
> 
> On May 14, 2012, at 8:04 AM, Fabrice wrote:
> 
>> 
>> Hello,
>> 
>> I've a problem with WcfPerOperation lifestyle after upgraded my project from 
>> Castle 2.5.2 to Castle 3.0
>> I've posted on StackOverflow and only after I thinked it could be better to 
>> post here...
>> 
>> But anyway here is the link: 
>> http://stackoverflow.com/questions/10579236/componentresolutionexception-after-upgrading-to-castle-3-0
>>  
>> 
>> Thank you for any help!
>> Fabrice
>> 
>> -- 
>> 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.

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