Session types—transient and persistent—let you control how multiple viewers and editors access branch versioned feature services. By default, a web map or web scene with branch versioned feature services (a ServiceGeodatabase version) loads as a Enums.FeatureServiceSessionTypeTransient type; you can change this type to Enums.FeatureServiceSessionTypePersistent at the map or scene level when you load the map or scene.
When you switch the ServiceGeodatabase version being used via ServiceGeodatabase::switchVersion(string), a read operation is started on the new version before releasing the previous version. If acquiring a shared lock on the new version fails (for example, if another user is editing the version), an error is raised. This behavior allows you to keep the user connected to the original version when the version they want is not yet available.
For additional ways to manage multiple viewers and editors in branch versioned data, such as using multiple tiers of editors, see the ArcGIS Pro discussion on branch version scenarios.
The FeatureServiceSessionType can be one of:
If one or more read operations were already being performed on the ServiceFeatureTable when an edit operation began (if a shared lock was already in place), then the shared lock becomes an exclusive lock. When all edit operations are applied successfully, the exclusive lock returns to being a shared lock.
A call to ServiceGeodatabase::close will release an exclusive lock.
Note that if the ServiceGeodatabase version requested is the default version, no exclusive lock will be acquired.
Edit operations that trigger the locks described above:
- AttachmentListModel::addAttachment(url, string, string)
- AttachmentListModel::updateAttachment(Attachment, url, string, string)