Thanks Fabio and Donald. It was quite an insight realising that Wcf doesnt (by default) generate a context per call. Explains alot of our problems.
Thanks for the help. Andy On 13 Nov, 23:28, Fabio Maulo <[email protected]> wrote: > ah... > and don't forget to configure NH > > <property name="current_session_context_class"> > uNhAddIns.SessionEasier.Contexts.ThreadLocalSessionContext, > uNhAddIns > </property> > > 2009/11/13 Fabio Maulo <[email protected]> > > > > > > > I'm using that implementation in WindowsAzure and it is working fine. > > In your service you shouldn't inject the container but the DAO/Repository > > or DaoDactory and blahblah > > The other matter is the service factory. > > As service factory I'm using a service-locator and, as described in the > > post, I'm using > >http://www.codeplex.com/CommonServiceLocator > > > in this case with the implementation for Castle.Windsor. > > > wait... perhaps there is an example in uNhAddIns (I can't recall > > everything...).. no.. I'm moking the SL in the test.. > > btw > > var sl = new WindsorServiceLocator(container); > > ServiceLocator.SetLocatorProvider(() => sl); > > container.Register(Component.For<IServiceLocator>().Instance(sl)); > > > 2009/11/13 Sandra <[email protected]> > > >> Hi Fabio > > >> Thanks for the article but I cannot make it work. > >> I've changed my config file as mensioned in your article. > >> Here is how my service looks like: > > >> private IWindsorContainer container; > > >> public MyService(IWindsorContainer container) > >> { > >> this.container = container; > >> } > > >> I get the following error message on NhSessionPerCallContextBehavior's > >> constructor: 'Object reference not set to an instance of an object.' > >> This is because ServiceLocator throws an exception. > > >> appreciate your help. > > >> Sandra > > > -- > > Fabio Maulo > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
