ArcGIS Pro applies and releases locks on datasets in an enterprise geodatabase as users view and edit data. These locks are needed to maintain the consistency of the data and versions. As objects in a geodatabase are locked, access to these objects changes based on whether a shared or exclusive lock is held.
When working with enterprise geodatabase datasets, the versioning type used will determine the locking behavior. It is important to have a clear understanding of how locking works, as this will impact the user experience. For example, when working with a traditional versioned dataset in a named version, more than one user can edit at the same time. This is due to a shared version lock being obtained. When working with a branch versioned dataset in a named version, only one editor is allowed at a time. This behavior is enforced by an exclusive version lock being obtained when editing a named branch version.
You can view locks in an enterprise geodatabase using the Geodatabase Administration dialog box. This lists locks with properties to help identify which user may be blocking you from completing operations on specific datasets or versions. This helps to coordinate editing processes with others and make schema changes to your datasets. The geodatabase administrator can view and manage all data and version locks in the geodatabase. This allows the administrator to see which connections may be blocking the completion of a maintenance task, such as reconciling data, compressing the geodatabase, or upgrading.
There are different lock modes for an enterprise geodatabase. A shared or exclusive lock mode is used depending on the operation being performed and the registration type of the dataset.
A shared lock is acquired on an individual dataset when it is in use, for example, anytime a user is editing or querying the contents of a feature class or table. This mechanism is used so other users cannot make changes to the underlying dataset and its schema while it is in use. Any number of shared locks can be established on a single feature class or table at a given time.
An exclusive lock is used to lock a dataset in the geodatabase from use by others to make necessary changes to it, for example, to reconcile a version. Once a user with proper permissions starts to make changes to a dataset in the geodatabase, an exclusive lock is established on the individual attribute table, feature class table, raster table, or other dataset. However, if a shared lock exists on that dataset, an exclusive lock cannot be established.
An exclusive lock is promoted from a shared lock and demoted back to a shared lock when no longer needed. Only one exclusive lock is allowed at a time on a dataset or version.
There are several different lock types used when working with an enterprise geodatabase. The lock type used depends on the registration type of the dataset and the operation.
A shared schema lock is acquired anytime a dataset is opened in ArcGIS Pro. When the schema of the dataset is modified in any way, that shared schema lock is promoted from shared to exclusive for the duration of the schema changes. This provides consistency in a multiuser environment by preventing the schema of a dataset from changing when other users have that dataset open.
A shared state lock is acquired anytime a traditional versioned dataset is accessed. The specific state_id is listed as the object name for the lock. This lock type is only valid for traditional versioned datasets.
A version lock type is acquired when accessing versioned datasets for an enterprise geodatabase. The lock mode differs based on the operation being performed and the versioning type for the dataset.
- Branch versioning—A shared version lock is acquired when viewing a branch versioned dataset by adding it to a map. When editing, the lock mode for the version lock depends on the version being edited:
- Default—When editing the default version, a shared version lock remains.
- Named version—When editing a named version, the shared version lock is promoted to an exclusive lock.
- Traditional versioning—A shared version lock is acquired when a traditional versioned dataset is actively being edited. During a reconcile operation, the shared version lock is promoted to an exclusive version lock.
OID Reservation locks
An OID Reservation lock is acquired when a branch versioned dataset is being edited. Object IDs are reserved to limit the number of trips to the database to fetch object IDs during edit operations. This lock type is only valid for branch versioned datasets.