GlobalObjects
|
Access to persistent objects for other instances (in multi-user operation) can be restricted in many ways, respectively rights can be granted for an instance of a persistent object (see also glo::EnLockMode). Individual objects or groups of objects can be locked. In principle, the individual locks must be removed using the corresponding unlock method with the same parameters.
It is also possible to query the current locks of other instances for each persistent object.
Every persistent object can be locked in the object database if the desired lock mode has not yet been restricted by another instance. This can be initiated either via glo::BasePersistent::lock (...) , glo::Reference::lock (...) or glo::Base::lockObject (...).
Another possibility is to use a glo::TPointerSet, a glo::TPointerList, a glo::TOndemandSet or a glo::TOndemandList. A lock can be set in these containers. Every object that is inserted into the container is automatically locked with the lock of the container, or released again when it is removed from the container.
A group of persistent objects can either be locked arbitrarily via a list of their glo::ObjID's using glo::Base::lockObjIdList (...) or by passing a subclass of glo::BaseLot to method glo::Base::lockLot (...) or by directly calling glo::BaseLot::lock(glo::EnLockMode eLockMode, glo::EnDeepMode eDeepMode) respectively glo::BaseLot::unlock(glo::EnLockMode eLockMode, glo::EnDeepMode eDeepMode) bzw. glo::BaseLot::unlock(const glo::LockSpecification & rLockSpecification).
Whether a persistent object is locked with a certain mode can be directly communicated by the object itself via glo::BasePersistent::isLocked (...) or the glo::ObjID of the object to be checked is passed to glo::Base::isLockedObject (...).
Whether a persistent object can be read, written and/or deleted can be determined directly from the object itself via glo::BasePersistent::isPossible (...) or with glo::ObjID via glo::Base::isPossible (...).
In order to find out all the remaining possibilities of a persistent object in the object database, the methods glo::BasePersistent::getProcessingPossibilities (...) or glo::Base::getProcessingPossibilities (...) are available.