ravendb, castle IoC ,Wcf facility - doc session liefstyle:

Showing 1-7 of 7 messages
ravendb, castle IoC ,Wcf facility - doc session liefstyle: Wayne Douglas 3/15/11 3:28 AM

Hi

What's the recommended lifestyle for raven doc session and store under a windsor ioc, wcf facility setup hosted in IIS?
--
Cheers,

w://
Re: ravendb, castle IoC ,Wcf facility - doc session liefstyle: Wayne Douglas 3/15/11 3:44 AM
the reason i ask is because i keep seeing this error:

Error TempPathInUse (JET_errTempPathInUse, Temp path already used by another database instance)


here is how i add the doc store and session to the ioc:


public class RavenInstaller : IWindsorInstaller
   
{
       
public void Install(IWindsorContainer container, IConfigurationStore store)
       
{
            container
.Register(
               
Component.For<IDocumentStore>().ImplementedBy<DocumentStore>()
                   
.DependsOn(new { connectionStringName = "RavenConnectionString" })
                   
.OnCreate(DoInitialisation)
                   
.LifeStyle.Singleton,
               
Component.For<IDocumentSession>()
                   
.UsingFactoryMethod(GetDocumentSesssion)
                   
.LifeStyle.Transient
               
);

            container
.Register(Component.For<IEventSeriesRepository>().ImplementedBy<EventSeriesRepository>().LifeStyle.Transient);
            container
.Register(Component.For<IEventInstanceRepository>().ImplementedBy<EventInstanceRepository>().LifeStyle.Transient);
            container
.Register(
               
Component.For<IProductionCompanyRepository>().ImplementedBy<ProductionCompanyRepository>().LifeStyle.
                   
Transient);
       
}

       
static IDocumentSession GetDocumentSesssion(IKernel kernel)
       
{
           
var store = kernel.Resolve<IDocumentStore>();
           
return store.OpenSession();
       
}

       
public static void DoInitialisation(IKernel kernel, IDocumentStore store)
       
{
            store
.Initialize();
           
IndexCreation.CreateIndexes(typeof(EventSeries_ByName).Assembly, store);

       
}
   
}
--
Cheers,

w://
Re: [RavenDB] ravendb, castle IoC ,Wcf facility - doc session liefstyle: Ayende Rahien 3/15/11 4:54 AM
Singleton for the Document Store, Trasient / Web Request for the session.
Re: [RavenDB] Re: ravendb, castle IoC ,Wcf facility - doc session liefstyle: Ayende Rahien 3/15/11 4:55 AM
Are you using the embedded version?

On Tue, Mar 15, 2011 at 12:44 PM, Wayne Douglas <codin...@googlemail.com> wrote:
the reason i ask is because i keep seeing this error:

Error TempPathInUse (JET_errTempPathInUse, Temp path already used by another database instance)


here is how i add the doc store and session to the ioc:


public class RavenInstaller : IWindsorInstaller
   
{
       
public void Install(IWindsorContainer container, IConfigurationStore store)
       
{
            container
.Register(
               
Component.For<IDocumentStore>().ImplementedBy<DocumentStore>()
                   
.DependsOn(new { connectionStringName = "RavenConnectionString" })
                   
.OnCreate(DoInitialisation)
                   
.LifeStyle.Singleton,
               
Component.For<IDocumentSession>()
                   
.UsingFactoryMethod(GetDocumentSesssion)
                   
.LifeStyle.Transient
               
);

            container
.Register(Component.For<IEventSeriesRepository>().ImplementedBy<EventSeriesRepository>().LifeStyle.Transient);
            container
.Register(Component.For<IEventInstanceRepository>().ImplementedBy<EventInstanceRepository>().LifeStyle.Transient);
            container
.Register(
               
Component.For<IProductionCompanyRepository>().ImplementedBy<ProductionCompanyRepository>().LifeStyle.
                   
Transient);
       
}

       
static IDocumentSession GetDocumentSesssion(IKernel kernel)
       
{
           
var store =
...

[Message clipped]  

Re: [RavenDB] Re: ravendb, castle IoC ,Wcf facility - doc session liefstyle: Wayne Douglas 3/15/11 5:04 AM
hosted in IIS--
Cheers,

w://
Re: [RavenDB] Re: ravendb, castle IoC ,Wcf facility - doc session liefstyle: Wayne Douglas 3/15/11 5:05 AM
i am now using the latest drop on my server rather than locally and it seems fine...

--
Cheers,

w://
Re: [RavenDB] Re: ravendb, castle IoC ,Wcf facility - doc session liefstyle: Ayende Rahien 3/15/11 5:17 AM
Oh, yes, I remember this. That was fixed in the latest build