Enterprise geodatabase locks

ArcGIS Pro applies and releases locks on objects 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 mode is used.

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.

Learn more about how to manage geodatabase locks

Lock modes

A shared or exclusive lock mode is used depending on the operation being performed.

Shared

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.

Exclusive

An exclusive lock is used to lock an object in the geodatabase from use by others to make necessary changes to it. Once a user with proper permissions starts to make changes to a dataset in the geodatabase, an exclusive lock is established on the object. If a shared lock exists on that dataset, an exclusive lock cannot be established. For example, to unregister a feature class as versioned, an exclusive lock is required on the dataset.

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.

Lock types

There are several lock types that are used when working with an enterprise geodatabase. The lock type used depends on the registration type of the dataset and the operation.

Schema lock

ArcGIS applications and web layers work on the principle that the geodatabase schema remains fixed and does not change while you are working with data in the geodatabase. For example, the consumers of a map image layer expect that the schema of the data in the map image layer will not change.

To enable this consistency, any time a dataset is accessed—such as when you add it to a map in ArcGIS Pro or when a dataset is used by a web layer—a shared schema lock is acquired on the dataset. 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.

If other users are accessing the same geodatabase dataset in which you need to make schema changes, you must establish workflows to make schema changes when the dataset is not in use. For example, to make changes without impacting other users, schedule your schema work to be performed when all other users are off the system. If the dataset is published to a service, stop the service and make the schema changes. See Change schema in map services in the ArcGIS Server help for more information.

State lock

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.

Version lock

A version lock is acquired when reading and editing within versions to ensure that certain operations can be performed in isolation. The lock mode differs based on the operation being performed and the versioning type of the dataset.

Lock modes working with versions

The type of locks used with various versioning are as follows:

  • Branch versioning—A shared version lock is acquired when a session starts reading. This occurs in ArcGIS Pro when viewing a branch versioned service by adding it to a map. When editing, the lock mode for the version lock may change on the version being edited as follows:
    • Default—When editing the default version, a shared version lock remains.
    • 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.

User experience working with versions

The user experience when working with versions and locks is as follows:

  • Branch versioning
    • Default—Multiple concurrent readers and editors are supported.
    • Version—A single editor is supported.
      Note:

      When editing a named version, the locking model differs depending on the ArcGIS Enterprise version.

      • For ArcGIS Enterprise 12.0 and later, the locking model allows multiple simultaneous viewers and a single editor. Write locks block other write locks, but allow readers. During the reconcile process, an exclusive version lock is acquired that blocks both readers and writers. If an editor attempts to reconcile while there are viewers accessing the version, an error is received.
      • For ArcGIS Enterprise 11.5 and earlier, the locking model allows for either multiple simultaneous viewers or a single editor. If a user attempts to start editing while there are other viewers or editors accessing the version, an error is received.

      The geodatabase administrator can use the Geodatabase Administration > Locks view to manage geodatabase locks and disconnect any users blocking editing and reconcile operations.

  • Traditional versioning—Multiple concurrent readers and editors are supported.

OID reservation lock

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.


In this topic
  1. Lock modes
  2. Lock types