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 at the beginning of the first read operation and the lock is kept until ServiceGeodatabase::close or ServiceGeodatabase::switchVersion(string) methods are called. A call to ServiceFeatureTable::clearCache(bool) also ends a read session if the ServiceFeatureTable is in Enums.FeatureRequestModeManualCache.
The following read operations are affected by this behavior:
- ArcGISFeatureTable::queryRelatedFeatureCountWithParameters(Feature, RelatedQueryParameters)
- ServiceFeatureTable::populateFromService(QueryParameters, bool, list<string>)
- ServiceFeatureTable::queryFeaturesWithFieldOptions(QueryParameters, Enums.QueryFeatureFields)
- ServiceFeatureTable::queryRelatedFeaturesWithFieldOptions(Feature, RelatedQueryParameters, Enums.QueryFeatureFields)
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:
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.
The following edit operations are affected by this behavior:
- AttachmentListModel::addAttachment(url, string, string)
- AttachmentListModel::updateAttachment(Attachment, url, string, string)
The FeatureServiceSessionType can be one of: