ravendb из консольного приложения - PullRequest
1 голос
/ 01 декабря 2010

Я пытаюсь заставить raven работать в консоли rhino.etl для импорта даты из sql в raven.

У меня есть 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();
        }
    }

Однако - когда я звоню_documentSession.OpenSession () приложение просто зависает.

Что мне нужно указать для среды консольного приложения?Он все время говорит, что время истекло - но URL-адрес в конфигурации - localhost: 8080, что правильно?

Я изменил его, чтобы теперь использовать:

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();
                }
            }

, но все еще висит на opensession.

1 Ответ

1 голос
/ 01 декабря 2010

Где на самом деле происходит зависание? В каком методе внутри OpenSession?

...