RavenDb Config and DocumentStore abstraction?

Go To StackoverFlow.com

3

I am using RavenDb across multiple projects and solutions to access three different databases that are all part of the same product. For instance, I have multiple MVC projects that fetch user info and some data out of the 'web' centric database and the 'backend' database, using '-' for the id override (but I need this only for a subset of classes in the 'web' db). And then I have another 'backend' database that is used by services (as well as the MVC projects). And finally a third temp/scratch database I use by another set of services to build the backend db. And of course, all of these are being accessed from different class libraries and even console test, seed, and integration test apps.

Managing all of these is becoming quite a nuisance. Every time I create a new console app or class library that access the db, I have to setup config and raven packages for each project, make sure indexes are built, etc.... Not to mention running update on all nuget updates, or in my case, installing a new unstable version of the server/client binaries.

Is there an easier way to manage this?

I tried to abstract the DocumentStore creation and initialization, as well as index creation into it own project and reference that. But the other projects then had to manually add newtonsoft.json (and nlog) from the package directory.

As well, I am getting the following when I try and abstract the DocumentStore into a class with a static property: StackTrace of un-disposed document store recorded. Please make sure to dispose any document store in the tests in order to avoid race conditions in tests.

Anyone have any thoughts on handling these issues?

Thanks

2012-04-04 20:47
by Joshua Ball
Is this still an issue? The Raven 2.0 client does not have the dependency on newtonsoft.json and nlog - Matt Johnson 2013-02-08 00:20


-2

I don't think that the manual addition of the references is a big issue, but you can add the actual nuget references as well. Note that the DocumentStore not disposed error is something that only happened in the unstable (debug builds), and won't happen on release builds.

2012-04-04 21:14
by Ayende Rahien
Ads