A session is held open as long as tables are actively reading or writing.

  • With a Read operation— When a user starts a read operation, a shared lock is placed on the ServiceGeodatabase version at the beginning of the read operation. A shared lock allows multiple users using read operations to access the service feature table at the same time. The shared lock is kept until ServiceGeodatabase.close() or ServiceGeodatabase.switchVersion(String) methods are called. If the ServiceFeatureTable is in FeatureRequestMode.ManualCache, you can call ServiceFeatureTable.clearCache(Boolean) to end a read session.

  • With an Edit operation— When a user starts an edit operation in the list below, an exclusive lock is placed on the affected ServiceFeatureTable at the beginning of the edit operation. An exclusive lock prevents all other users from connecting to the version. They cannot view, query, or edit that version.

The lock is held until one of the following methods is called:

  • ServiceFeatureTable.undoLocalEdits()

  • ServiceGeodatabase.undoLocalEdits()

  • ServiceFeatureTable.applyEdits()

  • ServiceGeodatabase.applyEdits()

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:

  • FeatureTable.addFeature(Feature)

  • FeatureTable.addFeatures(MutableListImpl)

  • FeatureTable.deleteFeature(Feature)

  • FeatureTable.deleteFeatures(MutableListImpl)

  • FeatureTable.updateFeature(Feature)

  • FeatureTable.updateFeatures(MutableListImpl)

  • ArcGISFeature.addAttachment(String, String, ByteArray)

  • ArcGISFeature.updateAttachment(Attachment, String, String, ByteArray)

  • ArcGISFeature.deleteAttachment(Attachment)

  • ArcGISFeature.deleteAttachments(MutableListImpl)