Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDB: Getting exception for in memory Document Store "Voron is prone to failure in 32-bits mode."

After following RavenDB's documentation

http://ravendb.net/docs/article-page/2.5/csharp/samples/raven-tests/createraventests

I am not able to successfully get a unit test to run past the creation of the in memory document store. I copy and pasted the test sample found in the documentation above using RavenDB's RavenTestBase.

[TestClass]
public class IndexTest : RavenTestBase
{
    [TestMethod]
    public void CanIndexAndQuery()
    {
        using (var store = NewDocumentStore())
        {
            new SampleData_Index().Execute(store);

            using (var session = store.OpenSession())
            {
                session.Store(new SampleData
                {
                    Name = "RavenDB"
                });

                session.SaveChanges();
            }

            using (var session = store.OpenSession())
            {
                var result = session.Query<SampleData, SampleData_Index>()
                    .Customize(customization => customization.WaitForNonStaleResultsAsOfNow())
                    .FirstOrDefault();

                Assert.Equals(result.Name, "RavenDB");
            }
        }
    }
}

public class SampleData
{
    public string Name { get; set; }
}

public class SampleData_Index : AbstractIndexCreationTask<SampleData>
{
    public SampleData_Index()
    {
        Map = docs => from doc in docs
                      select new
                      {
                          doc.Name
                      };
    }
}

Upon reaching NewDocumentStore()... I receive the following exception:

"Exception was unhandled by user code Voron is prone to failure in 32-bits mode. Use Raven/Voron/AllowOn32Bits to force voron in 32-bit process."

I am using Visual Studio 2013 (Update 4) and RavenDB 3.0

Thanks!

like image 298
Arsenio Latimore Avatar asked May 28 '15 21:05

Arsenio Latimore


Video Answer


1 Answers

In the constructor for NewDocumentStore pass in the configureStore parameter. This is an Action that takes the EmbeddableDocumentStore as its parameter. Within that action you can set different parts of the Configuration, including the AllowOn32Bits property.

public void ConfigureTestStore(EmbeddableDocumentStore documentStore)
{
    documentStore.Configuration.Storage.Voron.AllowOn32Bits = true;
}

Then pass this as the configureStore argument in the constructor.

using (var store = NewDocumentStore(configureStore:ConfigureTestStore))
like image 75
Chrisgh Avatar answered Oct 15 '22 02:10

Chrisgh