diff --git a/src/lib/common/softhsm2.conf.5.in b/src/lib/common/softhsm2.conf.5.in index 23b1fe7b..c55fc95e 100644 --- a/src/lib/common/softhsm2.conf.5.in +++ b/src/lib/common/softhsm2.conf.5.in @@ -103,12 +103,9 @@ library.reset_on_fork = true .RE .LP .SH OBJECTSTORE.READREFRESH -If set to false, then this will affect the refreshing of the object store in -the following way before an object is used but not changed: -.IP * 2 -No files will be read if 'objectstore.backend = file'. -.IP * 2 -No wait for mutex to unlock if 'objectstore.backend = db'. +If set to false and if 'objectstore.backend = file', then this will affect +the refreshing of the object store. +Before using an object that is not changed, no files will be read. .LP Depending of what kind of HW that is used setting 'false' may improve the performance of the HSM. @@ -119,7 +116,9 @@ unmodified or deleted object even if it is changed or deleted. Another process may have called C_DestroyObject or C_SetAttributeValue. But every time a process gets a new handle for an object the objectstore of this process is updated for all objects even if this property is false. -.LP +.LP +If 'objectstore.backend = db' then the value of this property is ignored. +.LP Default is true. .LP .RS diff --git a/src/lib/object_store/DBObject.cpp b/src/lib/object_store/DBObject.cpp index 273e657c..960b46ad 100644 --- a/src/lib/object_store/DBObject.cpp +++ b/src/lib/object_store/DBObject.cpp @@ -1362,15 +1362,10 @@ bool DBObject::deleteAttribute(CK_ATTRIBUTE_TYPE type) } // The validity state of the object -// If not 'doRefresh' we know that the object allready exists in the DB -// and hence _objectId should have been initialized. -bool DBObject::isValid(const bool doRefresh) +bool DBObject::isValid(const bool doRefresh __attribute__((unused))) { - if (doRefresh) - { - // Wait for update of object. - MutexLocker lock(_mutex); - } + MutexLocker lock(_mutex); + return _objectId != 0 && _connection != NULL; }