I'm running windows 7 64bit, RavenDB Embedded 1.0.701, MVC 3, C#, VS 2010 Pro.
After following the instructions on RavenDB's site, I get a "Could not open transactional storage: F:/RavenDBDataStore/Data" w/ inner exception "Temp path already used by another database instance" exception after the first RELOAD of a asp.net page.
I tried disposing of the document store but I get another exception in my view.
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);
}
Try to follow the steps described here:
Using RavenDB in an ASP.NET MVC website
Special attention on Managing sessions part...
If you're using IIS Express to debug your app, try to kill it before debugging the app...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With