Esempio n. 1
0
        public RavenDbDataStore()
        {
            _ravenDbCachePath = Path.Combine(
                _tempRavenDbPath,
                Path.Combine(
                    "CompiledIndexCache",
                    Guid.NewGuid().ToString())
                );

            _embeddableDocumentStore = new EmbeddableDocumentStore
            {
                Configuration =
                {
                    CacheDocumentsInMemory                                   = true,
                    RunInUnreliableYetFastModeThatIsNotSuitableForProduction = true,
                    RunInMemory                                              = true,
                    CompiledIndexCacheDirectory                              = _ravenDbCachePath,
                    TempPath = _tempRavenDbPath,
                    Settings =
                    {
                        { "Raven/FileSystem/DisableRDC", "true"               },
                        { "Raven/ActiveBundles",         "Unique Constraints" }
                    },
                    Storage                                                  =
                    {
                        PreventSchemaUpdate  = true,
                        SkipConsistencyCheck = true
                    }
                },
                Conventions =
                {
                    DisableProfiling              = true,
                    MaxNumberOfRequestsPerSession = 1000
                }
            };

            _ = _embeddableDocumentStore.RegisterListener(new UniqueConstraintsStoreListener());
            _embeddableDocumentStore.Configuration.Storage.Voron.AllowOn32Bits = true;
            _embeddableDocumentStore.Configuration.Storage.Voron.TempPath      = _tempRavenDbPath;

            _ = _embeddableDocumentStore.Initialize();

            _embeddableDocumentStore.AttachIndexesBeforeUse();
            _embeddableDocumentStore.AttachTransformersBeforeUse();
        }