8

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);
}
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
Jason Foglia
  • 2,414
  • 3
  • 27
  • 48

1 Answers1

1

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

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
  • I experience this problem during worker process recycles, the referenced page doesn't seem to solve the underlying problem, it simply defers it so that it would only occur during app recycles. This is less of a problem with IIS Express, but it can still occur. Any recommendations for preventing this from occurring during an app recycle as well? – Shaun Wilson Nov 25 '13 at 19:36
  • @ShaunWilson ... I have no idea. I think you could try contacting Ayende (the guy behind RavenDB) http://stackoverflow.com/users/6366/ayende-rahien or posting a question at the official forum. I'm sure Ayende will take a look: https://groups.google.com/forum/#!forum/ravendb – Leniel Maccaferri Nov 25 '13 at 20:06