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.

Reply via email to