Fix some CouchDB and update/commit things
All threads resolved!
All threads resolved!
Compare changes
+ 97
− 114
@@ -13,14 +13,12 @@ Todo: Add module docstring
@@ -13,14 +13,12 @@ Todo: Add module docstring
@@ -30,6 +28,9 @@ from aas import model
@@ -30,6 +28,9 @@ from aas import model
This Backend stores each Identifiable object as a single JSON document in the configured CouchDB database. Each
@@ -39,18 +40,16 @@ class CouchDBBackend(backends.Backend):
@@ -39,18 +40,16 @@ class CouchDBBackend(backends.Backend):
@@ -62,8 +61,8 @@ class CouchDBBackend(backends.Backend):
@@ -62,8 +61,8 @@ class CouchDBBackend(backends.Backend):
@@ -75,13 +74,9 @@ class CouchDBBackend(backends.Backend):
@@ -75,13 +74,9 @@ class CouchDBBackend(backends.Backend):
@@ -101,69 +96,82 @@ class CouchDBBackend(backends.Backend):
@@ -101,69 +96,82 @@ class CouchDBBackend(backends.Backend):
couchdb_s = re.match("couchdbs://", source) # Note: Works, since match only checks the beginning of the string
_credentials_store: urllib.request.HTTPPasswordMgrWithPriorAuth = urllib.request.HTTPPasswordMgrWithPriorAuth()
# Note: The HTTPPasswordMgr is not thread safe during writing, should be thread safe for reading only.
@@ -178,7 +186,8 @@ def register_credentials(url: str, username: str, password: str):
@@ -178,7 +186,8 @@ def register_credentials(url: str, username: str, password: str):
@@ -252,12 +261,8 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -252,12 +261,8 @@ class CouchDBObjectStore(model.AbstractObjectStore):
:raises CouchDBError: If error occur during the request to the CouchDB server (see `_do_request()` for details)
# If an HTTPError is raised, re-raise it, unless it is a 404 error and we are requested to create the
@@ -269,11 +274,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -269,11 +274,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -289,11 +290,9 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -289,11 +290,9 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -334,13 +333,12 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -334,13 +333,12 @@ class CouchDBObjectStore(model.AbstractObjectStore):
set_couchdb_revision("{}/{}/{}".format(self.url, self.database_name, self._transform_id(x.identification)),
@@ -378,25 +376,19 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -378,25 +376,19 @@ class CouchDBObjectStore(model.AbstractObjectStore):
raise KeyError("No AAS object with id {} exists in CouchDB database".format(x.identification)) from e
@@ -428,12 +420,9 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -428,12 +420,9 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -448,10 +437,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -448,10 +437,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):
:raises CouchDBError: If error occur during the request to the CouchDB server (see `_do_request()` for details)
@@ -476,10 +462,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):
@@ -476,10 +462,7 @@ class CouchDBObjectStore(model.AbstractObjectStore):