【问题标题】:Temp path already used by another database instance RavenDB MVC3另一个数据库实例 RavenDB MVC3 已使用的临时路径
【发布时间】:2012-03-15 04:48:33
【问题描述】:

我正在运行 Windows 7 64 位、RavenDB Embedded 1.0.701、MVC 3、C#、VS 2010 Pro。

按照 RavenDB 网站上的说明进行操作后,我在第一次重新加载 asp 后收到“无法打开事务存储:F:/RavenDBDataStore/Data”和内部异常“临时路径已被另一个数据库实例使用”异常.net 页面。

我尝试处理文档存储,但在我看来又遇到了另一个异常。

public ActionResult Index()
{
    EmbeddableDocumentStore documentStore = new EmbeddableDocumentStore { DataDirectory = "F:/RavenDBDataStore/" };
    documentStore.Initialize(); // <--- this is were I get the exception after reloading the page
    Dictionary<string, object> test = new Dictionary<string, object> {
            { "Name", 0 },
            { "Price", 3.99M },
            { "Expiry", new DateTime(2008, 12, 28) } ,
            { "Sizes", new string[] { "Small", "Medium", "Large" }} 
        };

    var results = new Object();
    using (IDocumentSession session = documentStore.OpenSession())
    {
        // Operations against session
        session.Store(test);
        session.SaveChanges();
        ViewBag.Display = session.Advanced.GetDocumentId(test);
        // Flush those changes
        session.SaveChanges();

        results = from c in session.Query<Dictionary<string, object>>()
                    select c;
    }
    return View(results);
}

【问题讨论】:

    标签: asp.net-mvc-3 exception instance ravendb


    【解决方案1】:

    尝试按照此处描述的步骤进行操作:

    Using RavenDB in an ASP.NET MVC website

    特别注意管理会话部分...

    如果您使用 IIS Express 调试您的应用程序,请在调试应用程序之前尝试将其终止...

    【讨论】:

    • 我在工作进程回收期间遇到了这个问题,引用的页面似乎并没有解决根本问题,它只是推迟了它,以便它只会在应用程序回收期间发生。这对于 IIS Express 来说不是问题,但它仍然可能发生。有什么建议可以防止在应用回收期间发生这种情况?
    • @ShaunWilson ...我不知道。我认为您可以尝试联系 Ayende(RavenDB 背后的人)stackoverflow.com/users/6366/ayende-rahien 或在官方论坛上发布问题。我相信 Ayende 会看看:groups.google.com/forum/#!forum/ravendb
    猜你喜欢
    • 1970-01-01
    • 2015-09-26
    • 2019-12-25
    • 1970-01-01
    • 2014-05-27
    • 2015-10-06
    • 2020-05-19
    • 2014-09-17
    • 1970-01-01
    相关资源
    最近更新 更多