Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Temp path already used by another database instance RavenDB MVC3

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);
}
like image 928
Jason Foglia Avatar asked Mar 14 '12 17:03

Jason Foglia


1 Answers

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...

like image 53
Leniel Maccaferri Avatar answered Nov 24 '22 14:11

Leniel Maccaferri