ravendb

ravendb, castle IoC ,Wcf facility - doc session liefstyle

a 夏天 提交于 2019-12-05 10:14:10
What's the recommended lifestyle for raven doc session and store under a windsor ioc, wcf facility setup hosted in IIS? I keep seeing this error: Error TempPathInUse (JET_errTempPathInUse, Temp path already used by another database instance)` here is my setup: public class RavenInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register( Component.For<IDocumentStore>().ImplementedBy<DocumentStore>() .DependsOn(new { connectionStringName = "RavenConnectionString" }) .OnCreate(DoInitialisation) .LifeStyle.Singleton, Component

Query product catalog RavenDB store for spec aggregate over arbitrary collection of products

家住魔仙堡 提交于 2019-12-05 08:53:11
This is a continuation of the project outlined in this question. I have the following model: class Product { public string Id { get; set; } public string[] Specs { get; set; } public int CategoryId { get; set; } } The "Specs" array stores product specification name value pairs joined by a special character. For example if a product is colored blue the spec string would be "Color~Blue". Representing specs in this way allows querying for products having multiple spec values specified by a query. There are two principal queries that I would like to support: Get all products in a given category.

Managing RavenDB IDocumentSession lifecycles with StructureMap for NServiceBus and MVC

旧时模样 提交于 2019-12-05 08:34:44
I am using NServiceBus v4.3, MVC4, RavenDB 2.5 and StructureMap 2.6.4 in our solution. I am having a similar issue under StructureMap to that described in this question 's responses where I require different lifecycles for the MVC Controller and NServiceBus Handler use of RavenDB's IDocumentSession in my Web project. Specifically in my case what happens is that if I use the HybridHttpOrThreadLocalScoped (as the above answer suggests for Windsor) lifecycle the sessions are not properly disposed of and I soon hit the 30 transaction limit error. If I use the HttpContext lifecycle my NSB event

Querying a Dictionary with RavenDb

ぃ、小莉子 提交于 2019-12-05 06:36:32
I have a class defined as: public class Student { public string Id { get; set; } public IDictionary<string, string> Attributes { get; set; } } based on the discussion I found here : http://groups.google.com/group/ravendb/browse_thread/thread/88ea52620021ed6c?pli=1 I can store an instance quite easily as : //creation using (var session = store.OpenSession()) { //now the student: var student = new Student(); student.Attributes = new Dictionary<string, string>(); student.Attributes["NIC"] = "studentsNICnumberGoesHere"; session.Store(student); session.SaveChanges(); } However when I query it as

RavenDb QueryYourWrites and Map/Reduce indexes

浪尽此生 提交于 2019-12-05 05:39:28
I got the following comment to my previous question about RavenDb: One thing to note, QueryYourWrites doesn't work with Map/Reduce indexes. For these you have to use WaitForNonStaleResults..() What does it mean? I thought all indexes in RavenDb are Map/Reduce indexes... In which cases does QueryYourWrites option work? Sorry, I wrote that comment and I wasn't very clear. RavenDB indexes always need to have a Map part, but the Reduce is optional. So if you don't specify a Reduce function, it's not a Map/Reduce index, it's just a Map index. That was the distinction I was trying to make. Because

RavenDB - Planning for scalability

送分小仙女□ 提交于 2019-12-05 03:40:13
I have been learning RavenDB recently and would like to put it to use. I was wondering what advice or suggestions people had around building the system in a way that is ready to scale, specifically sharding the data across servers, but that can start on a single server and only grow as needed. Is it advisable, or even possible, to create multiple databases on a single instance and implement sharding across them. Then to scale it would simply be a matter of spreading these databases across the machines? My first impression is that this approach would work, but I would be interested to hear the

RavenDB and SignalR Nuget Package Dependency Conflict

天涯浪子 提交于 2019-12-05 02:30:18
Basic conflict. SignalR wants Newtonsoft.Json version 4.0.7 or higher while RavenDB wants version equal to 4.0.5. Which obviously means they can't be installed side by side. So aside from downloading the source code from one of them and getting the dependencies figured out locally then have to check in the binary created from that, is there a possible way to keep the dependencies managed with NuGet, and maybe just forward the DLL Calls (like Mvc does with each new version for example)? We were running into the same issue a few days ago and this is a nasty one. We found that you can't keep the

RavenDb with ASP.NET MVC 3 - How to generate URL with ID?

孤街醉人 提交于 2019-12-05 00:55:44
This is probably a very simple answer, but i'm new to RavenDb, so i'm obviously missing something. I've got a basic object with the default convention for id: public string Id { get; set; } When i save it to the document store, i see it gets a value of like: posts/123 Which is fine, but...how do i generate a URL like this: www.mysite.com/edit/123 If i do this: @Html.ActionLink("Edit", "Posts", new { id = @Model.Id }) It will generate the followiung URL: www.mysite.com/edit/posts/123 Which is not what i want. Surely i don't have to do string manipulation? How do people approach this? RPM1984,

Updating documents in RavenDB

为君一笑 提交于 2019-12-04 22:57:53
If you add, delete or rename a property on a persisted entity, what's the easiest way to update the documents in RavenDB? Matt Warren RavenDB supports PATCH commands, see the docs for more info for more info. This way you can update a document directly without having to pull it from the server, update it and then send it back. Also you can run patches over multiple documents by using Set-based queries, see here for some more info. This lets you do the equivalent of UPDATE Users SET IsActive = false WHERE LastLogin < '2010-05-10' raven also has object tracking. so the following works: var doc =

Custom model binder with inheritance using Web API and RavenDB

本小妞迷上赌 提交于 2019-12-04 17:37:25
I'm developing a simple web app where I need to bind all types implementing and interface of a specific type. My interface has one single property like this public interface IContent { string Id { get;set; } } a common class using this interface would look like this public class Article : IContent { public string Id { get;set; } public string Heading { get;set; } } to be clean here the article class is just one of many different classes implementing IContent so therefor I need a generic way of storing and updating these types. So in my controller I have the put method like this public void Put