【发布时间】: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