logo       

Re: Bulk insert conflicts: msg#00138

db.couchdb.devel

Subject: Re: Bulk insert conflicts

On Fri, Jul 25, 2008 at 11:16 AM, Michael Hendricks
<michael-u4WEhoUc4zfYtjvyW6yDsg@xxxxxxxxxxxxxxxx>
wrote:

> The current bulk_docs behavior of failing the entire operation when one
> part fails is a very useful feature though. It allows for limited
> transactions. I use the bulk_docs feature to maintain the database in a
> consistent state when I need to delete one document and create another
> one. If either operation fails, I know that the entire bulk_docs
> request will fail and the database will still be in a consistent state.
>
> Perhaps using something like this as the body of the 412 response:
>
> {
> "ok":false,
> "conflict_revs": [
> {"id": "0", "attempted_rev": "1001", "current_rev": "1002"},
> {"id": "2", "attempted_rev": "5000", "current_rev": "5002"}
> ]
> }
>
> I removed "conflicts":true since that can be inferred from the presence
> of conflicted_revs.
>
> --
> Michael


That's true, I didn't think about transactions. That's much more useful than
following through with missing conflicted docs.

I like your solution much better than mine, Michael. +1
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise