ravendb

Securing the Raven Database

我的梦境 提交于 2019-12-02 07:59:36
I'm trying to restrict access to our RavenDB to only one user. After altering the settings to secure the DB, I can still access the RavenDB management studio and I'm not sure why. I'm running RavenDB as a windows service, and I'm using build 573. This is my Raven.Server.exe.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Raven/Port" value="*"/> <add key="Raven/DataDir" value="~\Data"/> <add key="Raven/AnonymousAccess" value="None"/> <!-- Settings are Get, All, None --> <add key="Raven/Authorization/Windows/RequiredUsers" value="FS-6103\PrestoDatabaseUser

WaitForNonStaleResults per DocumentStore

做~自己de王妃 提交于 2019-12-01 15:45:38
问题 Is there any way to tell RavenDb to use WaitForNonStaleResults mode for all queries of some DocumentStore or DocumentSession? 回答1: You can use DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites at the DocumentStore or Session level. DocumentStore: IDocumentStore store = new DocumentStore { Url = "http://127.0.0.1:8080", DefaultDatabase = "DBNAME", Conventions = { DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites } }.Initialize(); Session: session.Advanced

Configure RavenDB versioning via code

≯℡__Kan透↙ 提交于 2019-12-01 11:27:41
Is it possible to configure versioning on a new RavenDB database via code? I'm using the following code (based on http://ravendb.net/docs/2.0/server/extending/bundles/versioning ): Store.DatabaseCommands.EnsureDatabaseExists(database); using (var session = Store.OpenSession(database)) { session.Store(new { Exclude = false, Id = "Raven/Versioning/DefaultConfiguration", MaxRevisions = 5 }); session.SaveChanges(); } But when I add and modify records in the database versioning is not working. That code is good, but it just creates the configuration information that the Versioning Bundle will look

How do I use a Custom JSON.NET Converter in RavenDB to deserialize into types from a dynamic DLL?

冷暖自知 提交于 2019-12-01 09:29:15
My RavenDB objects are created from types in a DLL that is loaded dynamically. I cannot load the DLL into the execution context of the current AppDomain , so the JSON deserializer can't find the types. How would I use a Custom Converter to use the types in my loaded-at-runtime Assembly? NB I tried serving the DLL from another domain via the AppDomain but that caused conflicts later. Although it solved the problem in that question, I now need to make sure that all of my objects are created from types in the dynamically loaded Assembly. Where you want to specify the Assembly to generate the

Configure RavenDB versioning via code

雨燕双飞 提交于 2019-12-01 08:09:38
问题 Is it possible to configure versioning on a new RavenDB database via code? I'm using the following code (based on http://ravendb.net/docs/2.0/server/extending/bundles/versioning): Store.DatabaseCommands.EnsureDatabaseExists(database); using (var session = Store.OpenSession(database)) { session.Store(new { Exclude = false, Id = "Raven/Versioning/DefaultConfiguration", MaxRevisions = 5 }); session.SaveChanges(); } But when I add and modify records in the database versioning is not working. 回答1:

How do I use a Custom JSON.NET Converter in RavenDB to deserialize into types from a dynamic DLL?

强颜欢笑 提交于 2019-12-01 05:35:55
问题 My RavenDB objects are created from types in a DLL that is loaded dynamically. I cannot load the DLL into the execution context of the current AppDomain , so the JSON deserializer can't find the types. How would I use a Custom Converter to use the types in my loaded-at-runtime Assembly? NB I tried serving the DLL from another domain via the AppDomain but that caused conflicts later. Although it solved the problem in that question, I now need to make sure that all of my objects are created

“Could not find transactional storage type” error with embedded RavenDB

白昼怎懂夜的黑 提交于 2019-12-01 02:26:58
I was able to successfully run a simple test for RavenDB based on the code found at: http://ravendb.net/tutorials/hello-world Next I tried to run it in an Embedded Manner, but I keep on getting the following error: Message: Could not find transactional storage type: Raven.Storage.Esent.TransactionalStorage, Raven.Storage.Esent StackTrace: at Raven.Database.Config.InMemoryRavenConfiguration.CreateTransactionalStorage(Action notifyAboutWork) in c:\Builds\raven\Raven.Database\Config\InMemoryRavenConfiguration.cs:line 272 at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration

RavenDB Embedded on Azure Websites - Access Denied

99封情书 提交于 2019-11-30 22:26:09
I get an Access denied message when I try to deploy my MVC4 site with an Embedded instance of RavenDB to the new Azure Websites preview feature. The site works fine locally. Here is how I configure Raven: //Initialize the RavenDB Data Store Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8887); var documentStore = new EmbeddableDocumentStore() { DataDirectory = "~\\App_Data", UseEmbeddedHttpServer = true, Configuration = { Port = 8887 } }; documentStore.Initialize(); And here is the stack trace when I browse to the site: Access is denied Description: An unhandled

RavenDB changes metadata “Raven-Entity-Name”

允我心安 提交于 2019-11-30 22:10:17
I noticed that when I add a document to RavenDB and see the "Raven-Entity-Name" metadata it makes it plural. E.g. if my model name was Product it changes it to Products . Why such kind for behavior? If I have create an index I am forced to use docs.Products It's part of the philosophy of RavenDB to do convention over configuration, so it does this by default. But you can override it if you want to, you can do something like this: _documentStore = new DocumentStore { Url = "http://localhost:8080/" }; _documentStore.Conventions.FindTypeTagName = t => { if (t.Name == "MyClass") return

ASP.NET MVC 3, RavenDB, & Autofac Issue Plus 2 Other Autofac Questions

我怕爱的太早我们不能终老 提交于 2019-11-30 19:26:54
NOTE: There are 3 questions in here and I did not make separate questions since they are all somewhat related to the same code. I have the following code that registers the connection to my RavenDB in the Application_Start once per the application's life cycle: var store = new DocumentStore { Url = "http://localhost:8080" }; store.Initialize(); builder.RegisterInstance(store).SingleInstance(); Now this works fine and this is something that should be created only once per the application's life cycle. Now I wanted to add in the DocumentSession to Autofac so I tried to add in this in the