lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

db.create() creates document twice? #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is my first time with couchdb at all, so maybe this is expected 
behavior! Is it?

Thanks.

In [5]: server.delete('python-tests')

In [6]: db = server.create('python-tests')

In [7]: doc_id = db.create({'type': 'Person', 'name': 'John Doe'})

In [8]:
[1]  + 6559 suspended  ipython
mohamed ubuntu-vm:~ [4405%1:20]%
mohamed ubuntu-vm:~ [4405%1:20]% curl -X GET http://127.0.0.1:5984/python-
tests
{"db_name":"python-
tests","doc_count":2,"doc_del_count":0,"update_seq":2,"purge_seq":0,"compac
t_running":false,"disk_size":8281,"instance_start_time":"1253050288357513",
"disk_format_version":4}
mohamed ubuntu-vm:~ [4406%1]% fg
[1]  + 6559 continued  ipython

In [9]: import  couchdb
In [10]: couchdb.__version__
Out[10]: '0.7dev-r196'

Original issue reported on code.google.com by lrhazi on 15 Sep 2009 at 9:41

GoogleCodeExporter commented 8 years ago
I shoudl have shown this output, showing the two documents created:

[1]  + 6559 suspended  ipython
mohamed ubuntu-vm:~ [4407%1:20]% curl -X GET http://127.0.0.1:5984/python-
tests/_all_docs
{"total_rows":2,"offset":0,"rows":[
{"id":"8e190c2eb4009785c4724e1eb13dcd66","key":"8e190c2eb4009785c4724e1eb13dcd66
","va
lue":{"rev":"1-15f5381d15b8a7f2df90a477fe37a301"}},
{"id":"ed53522ff11e633c50c742d24dc54acc","key":"ed53522ff11e633c50c742d24dc54acc
","va
lue":{"rev":"1-15f5381d15b8a7f2df90a477fe37a301"}}
]}

Original comment by lrhazi on 15 Sep 2009 at 9:45

GoogleCodeExporter commented 8 years ago
This is due to a bug in httplib2 that causes a request to be incorrectly 
retried.

Short-term solution is to apply the patch attached to the httplib2 issue 
report, 
http://code.google.com/p/httplib2/issues/detail?id=67.

Original comment by matt.goo...@gmail.com on 15 Sep 2009 at 9:56