I have a python program that accesses a couchDB database, creates new documents and updates existing ones. For a given database, db, and document, Doc, I try to take care and reload the document before each modification:
somedoc = Doc.load(db,id)
before updating via
doc.store(db)
As far as I am aware this shouldn't be necessary, as doc.rev should be updated each time store is called. BUT ... I am getting conflict messages:
couchdb.http.ResourceConflict: (u'conflict', u'Document update conflict.')
Is there any way of just forcing no update and a warning message rather than having a fatal error upon these conflicts. Or, better, is there some way of quickly checking the document revision number - the db is being accessed by two scripts that both update, but both are careful to load each doc, make modifications quickly and update the db in as little time as possible to minimise the chance of a conflict....
Cheers