The Enums.FeatureServiceSessionType applies to both the read and edit sessions.
When the Enums.FeatureServiceSessionType is set to Enums.FeatureServiceSessionTypePersistent the following rules govern the lock type and duration: If session is a read session, then a shared lock is acquired when the ServiceGeodatabase is loaded and the lock is kept until either ServiceGeodatabase::close or ServiceGeodatabase::switchVersion(string) methods are called.
When ServiceGeodatabase::switchVersion(string) is called, a read session is started on the new version before releasing the session on the previous version. If acquiring a shared lock on the new version fails, an error is raised.
If session is an edit session, then an exclusive lock is acquired (by upgrading the shared lock) at the beginning of a write operation and held until one of the following methods is called: * ServiceFeatureTable::undoLocalEdits * ServiceGeodatabase::undoLocalEdits * ServiceFeatureTable::applyEdits * ServiceGeodatabase::applyEdits
When all edit operations are applied successfully the exclusive lock is demoted back to a shared lock. A call to ServiceGeodatabase::close will release the exclusive lock. Exception: If the current version is the default version, no exclusive lock will be acquired.
- AttachmentListModel::addAttachment(url, string, string)
- AttachmentListModel::updateAttachment(Attachment, url, string, string)
The FeatureServiceSessionType can be one of:
During read sessions, a shared lock will be held while tables are connected to the feature service, preventing other clients from editing the version.
During edit sessions, an exclusive lock will be held while edits have been made to the locally cached data, preventing other clients from both reading and editing. When all edits are successfully applied to the service, the exclusive lock is released.