来自控制台应用程序的 ravendb
我试图让 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 上。
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 environment? 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
挂起实际发生在哪里?在OpenSession里面什么方法?
Where is the hang actually occurs? In what method inside OpenSession?