Doesn't look like you are missing anything. I guess start debugging and stepping through code. :)
On Apr 8, 10:47 am, Patricia Vandermeer <[email protected]> wrote: > Thanks Beto! > I've added the DoNotWire attribute, but still am getting the "You are not in > a unit of work" error > > CurrentNHibernateSessionKey has a value, but there doesn't seem to be > anything in Local.Data to go with it. > > Here's the Property in NhibernateUnitofWorkFactory.cs > > [DoNotWire] > public ISession CurrentSession > { > get > { > ISession session = > (ISession)Local.Data[CurrentNHibernateSessionKey]; > if (session == null) > throw new InvalidOperationException("You are not in a > unit of work"); > return session; > } > set { Local.Data[CurrentNHibernateSessionKey] = value; } > } > > what am i missing? > > Thanks again for all the help! > > > > On Wed, Apr 7, 2010 at 2:03 PM, Beto <[email protected]> wrote: > > You can find the WindsorServiceLocator here: > > >http://commonservicelocator.codeplex.com/wikipage?title=Castle%20Wind... > > > On the property that you need to modify it will be under > > Rhino.Commons.NHibernateUnitOfWorkFactory: > > [DoNotWire] > > public ISession CurrentSession > > { > > get > > { > > ISession session = (ISession) > > Local.Data[this.CurrentNHibernateSessionKey]; > > if (session == null) > > { > > throw new InvalidOperationException("You are not in a unit > > of work"); > > } > > return session; > > } > > set > > { > > Local.Data[this.CurrentNHibernateSessionKey] = value; > > } > > } > > > On Apr 5, 1:05 pm, Patricia Vandermeer <[email protected]> > > wrote: > > > Hey Beto, > > > > Thanks for pointing me to that thread. I have read it. but I'm still in > > the > > > dark! > > > which property is being refered to in this post: > > > > > Yes, you would have to modify the property on UOW > > > > and where do i need to tell rhino security to use windsor like you say > > here: > > > > > ServiceLocator.SetLocatorProvider(() => new > > > > WindsorServiceLocator(IoC.Container)); > > > > Thank you for being patient! I really want/need to figure this out and > > it's > > > making my brain hurt :) > > > > Patricia > > > > On Wed, Mar 31, 2010 at 7:34 PM, Beto <[email protected]> wrote: > > > > Download the source code:http://github.com/lorenzomelato/rhino-commons > > > > Make Modifications. > > > > Compile > > > > > You can get more details on the attribute that you will have to modify > > > > from here: > > > > >http://groups.google.co.uk/group/rhino-tools-dev/browse_thread/thread. > > .. > > > > > -Humberto > > > > On Mar 31, 1:41 pm, Patricia Vandermeer > > > > <[email protected]> wrote: > > > > > Hi Humberto! > > > > > Thanks for the help. Can you elaborate more on what you mean by: > > > > > > > You will have to modify the Rhino.Commons source code to share the > > > > > > unitofwork.cerrentsession. > > > > > > I think my facility and resolver are pretty much the same as the one > > > > you've > > > > > got (except in vb :) ) > > > > > > and i'm getting the error "You are not in a unit of work" > > > > > in the NHibernateUnitOfWorkFactory.cs here: > > > > > > public ISession CurrentSession > > > > > { > > > > > get > > > > > { > > > > > ISession session = > > > > > (ISession)Local.Data[CurrentNHibernateSessionKey]; > > > > > if (session == null) > > > > > * throw new InvalidOperationException("You are not > > in > > > > a > > > > > unit of work");* > > > > > return session; > > > > > } > > > > > set { Local.Data[CurrentNHibernateSessionKey] = value; } > > > > > } > > > > > > i'm guessing this has to do with the sharing... i don't know > > > > > > It would be AMAZING if someone who has a working solution could post > > the > > > > > barest of barebones working console app w/ the newest versions of > > > > > everything. > > > > > > Thanks again! > > > > > > On Wed, Mar 17, 2010 at 4:09 PM, Patricia Vandermeer < > > > > > > [email protected]> wrote: > > > > > > Thanks Humberto! I will try to fix mine when i get back from my > > > > vacation > > > > > > :) > > > > > > > On Wed, Mar 17, 2010 at 3:51 PM, Humberto Franco < > > > > [email protected] > > > > > > > wrote: > > > > > > >> You will have to modify the Rhino.Commons source code to share the > > > > > >> unitofwork.cerrentsession. I will try to post a documentation > > article > > > > on > > > > > >> ayendes site sometime in the future. In the mean time here is what > > I > > > > have > > > > > >> for my facility and resolver: > > > > > >> public class RhinoSecurityFacility : AbstractFacility > > > > > >> { > > > > > >> protected override void Init() > > > > > >> { > > > > > > >> Kernel.Register( > > > > > >> Component.For<IAuthorizationService>() > > > > > >> .ImplementedBy<AuthorizationService>() > > > > > >> .LifeStyle.Transient, > > > > > >> Component.For<IAuthorizationRepository>() > > > > > >> .ImplementedBy<AuthorizationRepository>() > > > > > >> .LifeStyle.Transient, > > > > > >> Component.For<IPermissionsBuilderService>() > > > > > >> .ImplementedBy<PermissionsBuilderService>() > > > > > >> .LifeStyle.Transient, > > > > > >> Component.For<IPermissionsService>() > > > > > >> .ImplementedBy<PermissionsService>() > > > > > >> .LifeStyle.Transient > > > > > >> ); > > > > > > >> Kernel.Resolver.AddSubResolver(new > > > > > >> ServiceIsessionResolver(Kernel)); > > > > > > >> ServiceLocator.SetLocatorProvider(() => new > > > > > >> WindsorServiceLocator(IoC.Container)); > > > > > >> } > > > > > >> } > > > > > > >> public class ServiceIsessionResolver : ISubDependencyResolver > > > > > >> { > > > > > >> private IKernel Kernel { get; set; } > > > > > > >> public ServiceIsessionResolver(IKernel kernel) > > > > > >> { > > > > > >> Kernel = kernel; > > > > > >> } > > > > > > >> public object Resolve(CreationContext context, > > > > > >> ISubDependencyResolver contextHandlerResolver, ComponentModel > > model, > > > > > >> DependencyModel dependency) > > > > > >> { > > > > > >> return > > > > Kernel.Resolve<IUnitOfWorkFactory>().CurrentSession; > > > > > >> } > > > > > > >> public bool CanResolve(CreationContext context, > > > > > >> ISubDependencyResolver contextHandlerResolver, ComponentModel > > model, > > > > > >> DependencyModel dependency) > > > > > >> { > > > > > >> return > > > > > >> typeof(ISession).IsAssignableFrom(dependency.TargetType); > > > > > >> } > > > > > >> } > > > > > > >> On Wed, Mar 17, 2010 at 12:09 PM, patricia < > > > > [email protected] > > > > > >> > wrote: > > > > > > >>> Hey Beto, Everyone > > > > > > >>> I've made a facility, and set everything up like the thread you > > > > posted > > > > > >>> said to. But i'm not sure where i need to put the [DoNotWire] > > > > > >>> attribute! I'm getting this error: > > > > > >>> {"A cycle was detected when trying to resolve a dependency. The > > > > > >>> dependency graph that resulted in a cycle is: - Service > > dependency > > > > > >>> 'session' type 'NHibernate.ISession' for > > > > > >>> Void .ctor(NHibernate.ISession) in type > > > > > >>> Rhino.Security.Services.AuthorizationRepository - Parameter > > > > > >>> dependency 'configurationFileName' type 'System.String' for > > > > > >>> Void .ctor(System.Reflection.Assembly[], System.String) in type > > > > > >>> Rhino.Commons.NHibernateUnitOfWorkFactory + Parameter dependency > > > > > >>> 'configurationFileName' type 'System.String' for > > > > > >>> Void .ctor(System.Reflection.Assembly[], System.String) in > > > > > >>> Rhino.Commons.NHibernateUnitOfWorkFactory "} > > > > > > >>> this is my facility and sub resolver > > > > > > >>> Public Class RhinoSecurityFacility > > > > > >>> Inherits AbstractFacility > > > > > > >>> Protected Overloads Overrides Sub Init() > > > > > >>> Kernel.Resolver.AddSubResolver(New > > > > > >>> ServiceISessionResolver(Kernel)) > > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of INHibernateInitializationAware)() _ > > > > > >>> .ImplementedBy(Of NHibernateDbSchemaGeneration)()) > > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IEntityInformationExtractor(Of > > Org))() _ > > > > > >>> .ImplementedBy(Of > > > > > >>> VBRhinoSample.OrgInformationExtractor)() _ > > > > > >>> ) > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IEntityInformationExtractor(Of > > User))() _ > > > > > >>> .ImplementedBy(Of > > > > > >>> VBRhinoSample.UserInformationExtractor)() _ > > > > > >>> ) > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IEntityInformationExtractor(Of > > > > > >>> CustomField))() _ > > > > > >>> .ImplementedBy(Of > > > > > >>> VBRhinoSample.CustomFieldInformationExtractor)() _ > > > > > >>> ) > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IEntityInformationExtractor(Of > > > > > >>> Qualification))() _ > > > > > >>> .ImplementedBy(Of > > > > > >>> VBRhinoSample.QualificationFieldInformationExtractor)() _ > > > > > >>> ) > > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IPermissionsService) _ > > > > > >>> .ImplementedBy(Of > > > Rhino.Security.Services.PermissionsService).LifeStyle.Is(Castle.Core.Lifest > > > > yleType.Transient) > > > > > >>> _ > > > > > >>> ) > > > > > >>> Kernel.Register( _ > > > > > >>> Component.For(Of IPermissionsBuilderService) _ > > > > > >>> .ImplementedBy(Of > > > Rhino.Security.Services.PermissionsBuilderService).LifeStyle.Is(Castle.Core > > > > .LifestyleType.Transient) > > > > > >>> _ > > > > > >>> ) > > ... > > read more » -- You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" 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/rhino-tools-dev?hl=en.
