ArangoDB-Community / pyArango

Python Driver for ArangoDB with built-in validation
https://pyarango.readthedocs.io/en/latest/
Apache License 2.0
238 stars 90 forks source link

can not save document with multiple thread? #131

Closed Himan000 closed 5 years ago

Himan000 commented 5 years ago

Below is my code:

def insert_a_document(collection_name, bean): db = get_db() collection = get_collection(db, collection_name) doc = collection.createDocument() for key in bean.keys(): if key == "id": doc["_key"] = bean.get(key) else: doc[key] = bean.get(key) doc.save()

when use python ThreadPoolExecutor to run this mutiple thread saving by calling this insert_a_document, not all documents saved but some. It's strange, do you know why, how to solve it. Thanks.

ArangoDB version: v3.4.0 distribute Python: v3.5

Himan000 commented 5 years ago

I gave up this tool and transfered to python-arango. Python-arango is OK and more powerful.

tariqdaouda commented 5 years ago

Without the proper indentation, I can't help you debug this code.