couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klaus Trainer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-853) Update conflict after recreating a deleted document
Date Wed, 11 Aug 2010 09:56:17 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897199#action_12897199
] 

Klaus Trainer commented on COUCHDB-853:
---------------------------------------

This behaviour has nothing to do with deleting and recreating a document. I also wouldn't
call it a bug, since you need to specify the revision number in the PUT request's body instead
of as a query parameter.

Accordingly, you put your PUT request better like this:

curl -X PUT http://oz-lifecycle:5984/meine_db/test_doc_ABO -d "{\"_rev\":\"3-0c7606241b31f0566c527cd2a8c16367\"
, \"kuerzel\":\"ABO\"}" 

The first PUT request after the DELETE only succeeds, because after a DELETE, it isn't necessary
to specify a revision number (which is quite reasonable). Anyway, the rev query parameter
that you specified in the PUT request is ignored.

> Update conflict after recreating a deleted document
> ---------------------------------------------------
>
>                 Key: COUCHDB-853
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-853
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.11.1
>         Environment: Win Server 2008 R2, CouchDB 0.11.1
>            Reporter: André Bögge
>            Priority: Critical
>
> The problem occurs after deleting and recreating a document. I got an update conflict
writing the document after i recreated it. 
> curl -X PUT http://oz-lifecycle:5984/meine_db/test_doc_ABO -d "{\"name\":\"ABO\"}"
> --> {"ok":true,"id":"test_doc_ABO","rev":"1-d51b77d476e0aad1f9990e9a85849740"}
> D:\Programme\Curl>curl -X DELETE http://oz-lifecycle:5984/meine_db/test_doc_ABO?rev="1-d51b77d476e0aad1f9990e9a85849740"
> --> {"ok":true,"id":"test_doc_ABO","rev":"2-282f9cf6e648dcce08c426ffbf04c635"}
> D:\Programme\Curl>curl -X PUT http://oz-lifecycle:5984/meine_db/test_doc_ABO -d "{\"name\":\"ABO\"}"
> --> {"ok":true,"id":"test_doc_ABO","rev":"3-0c7606241b31f0566c527cd2a8c16367"}
> D:\Programme\Curl>curl -X PUT http://oz-lifecycle:5984/meine_db/test_doc_ABO?rev="3-0c7606241b31f0566c527cd2a8c16367"
-d "{\"kuerzel\":\"ABO\"}"
> --> {"error":"conflict","reason":"Document update conflict."}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message