Ah, thanks, that's good advice. You can still grab a bunch of the uuids from /_uuids and then use them, thus giving you good uuids and idempotency too.
b. On 16 March 2012 15:17, Alexander Shorin <[email protected]> wrote: > On Fri, Mar 16, 2012 at 7:09 PM, Robert Newson <[email protected]> wrote: >> That advice probably dates to when we made a fully random UUID. > > That advice based on wiki note: > http://wiki.apache.org/couchdb/HTTP_Document_API#POST > > ...and fully explained in method description: > >> If doc has no _id then the server will allocate a random ID and a new >> document will be created. Otherwise the doc’s _id will be used to identity >> the document to create or update. Trying to update an existing document with >> an incorrect _rev will raise a ResourceConflict exception. > >> Note that it is generally better to avoid saving documents with no _id and >> instead generate document IDs on the client side. This is due to the fact >> that the underlying HTTP POST method is not idempotent, and an automatic >> retry due to a problem somewhere on the networking stack may cause multiple >> documents being created in the database. > > If docid is specified on client, PUT request is used instead of POST > one. Workaround is already known: use /_uuids server resource for doc > ids source, but implementing this trick on library level is not good > idea due to it force to produce additional requests behind of scene. > > -- > ,,,^..^,,,
