couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <n.breun...@vpro.nl>
Subject Re: conflict resolving
Date Thu, 08 Oct 2009 14:34:49 GMT
Marijn Stollenga wrote:

> Thanks for the help guys! I also have another question. In the game I  
> am making there probably can be conflicts as a result of race- 
> conditions. I am not sure how I will resolve these, but one idea is to  
> find the conflicts in couchdb and resolve them with some routine.
> 
> What is the best way to find and resolve conflicts? I could make a  
> view that shows conflicting documents, which I periodically check and  
> then resolve. But I don't really like the fact that there are delays  
> in that setup (between conflict creation and finding it using the  
> view). Is there a way to hook up a conflict-resolver immediately as a  
> conflict gets created?

You should check the HTTP status code when you add data to your 
database. If you get back a 409 Conflict then you should perform your 
conflict resolving code.

Nils.

Mime
View raw message