开发者

ravendb from console app

I'm trying to get raven working in a rhino.etl console to import date from sql to raven.

I have a RavenInstaller:

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

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

        public static void DoInitialisation(IKernel kernel, IDocumentStore store)
        {
            store.Initialize();
        }
    }

However - when I call _documentSession.OpenSession() the app just hangs.

Is there something I need to specify for the console app environme开发者_如何学运维nt? It keeps saying it's timed out - but the url in the config is localhost:8080 which is correct?

i've changed it to now use:

using (var documentStore = new DocumentStore { Url = "http://localhost:8080" })
            {
                documentStore.Initialize();
                using (var session = documentStore.OpenSession())
                {
                    var mp = _container.Resolve<MainProcess>();
                    mp.DocumentSession = session;
                    mp.Execute();
                }
            }

but still hanging on opensession.


Where is the hang actually occurs? In what method inside OpenSession?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜