我试图让 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上。