Skip To Content

Query Locks

Description

Licencia:

The ArcGIS Location Referencing license is required to use this resource.

This operation queries the LRS locks table and returns a list of lock records that match the WHERE clause.

An error response is returned from this operation when conflict prevention is not enabled on the LRS. Refer to the conflictPreventionEnabled property of the Locks resource.

The eventFeatureClassName property in the response is populated for event lock objects and left empty for route lock objects.

Request Parameters

ParameterDetails
f

Optional parameter to specify the response format. The default response format is html.

Values: html | json

WHERE

Required

Description: A WHERE clause for the query filter. Any legal SQL WHERE clause that operates on LRS locks table fields is allowed.

Nota:

For branch versioned databases, we store the version GUID in the LRS locks table instead of the version name. Make sure your input WHERE clause includes the GUID instead of the name. You can find more information about branch versions by querying the versions endpoint in the Version Management Service.

returnReleasableStatus

Optional parameter specifying whether the response will contain the releasableStatus property. If returnReleasableStatus=true, the server will add a releasableStatus attribute to every object of the locks array in the response.

The possible releasableStatus values are:

  • no—When the current user does not hold the lock.
  • yes—When the current user holds the lock, but no edits have been made in the version associated with the lock on the line, route (or anything related to it such as a calibration point, centerline sequence, and so on), or event (in the case of an event lock).
  • onPost—When the current user holds the lock and the version associated with it has been modified by changes to the line, route (or anything related to it such as a calibration point, centerline sequence, and so on), or event (in the case of an event lock).

Example Usage

The following examples demonstrate lock queries by attribute.

Example 1

URL for querying locks by version name.

https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockVersion%3D'{20878084-24FC-40CB-8AF0-B7979CF9FE03}'

Example 2

URL for querying locks by username.

https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockUser%3D'alice'

Example 3

URL for querying locks by version name and username.

https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=LockVersion%3D'{20878084-24FC-40CB-8AF0-B7979CF9FE03}'%20and%20LockUser%3D'alice'

Example 4

URL for querying locks by route (or line) ID and network layer.

https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/locks/query?f=json&where=RouteId%20in('I90','US101')%20and%20NetworkId%3D1

JSON response syntax


{
  "locks" : [
    {
      "routeId" : "<routeId>",
      "layerId" : <layerId>,
      "lrsNetworkId" : <networkId>,
      "lrsNetworkName" : "<networkName>",
      "user" : "<username>",
      "versionName" : "<versionName>",
      "versionGuid": "<versionGuid",
      "lockDate" : <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    },
    {
      "lineId" : "<lineId>",
      "layerId" : <layerId>,
      "lrsNetworkId" : <networkId>,
      "lrsNetworkName" : "<networkName>",
      "user" : "<username>",
      "versionName" : "<versionName>",
      "versionGuid": "<versionGuid",
      "lockDate" : <timestamp>,
      "eventFeatureClassName": "<eventFeatureClassName>"
    } ,
    ...
  ]
}

JSON response example


{
  "locks" : [
    {
      "routeId" : "I90",
      "layerId" : 3,
      "lrsNetworkId" : 1,
      "lrsNetworkName" : "Highways",
      "user" : "alice",
      "versionName" : "bob.job_65",
      "versionGuid": "{66E39C10-9A79-4DC7-BDAC-F692251E91F7}",
      "lockDate" : 1397517340000,
      "eventFeatureClassName": ""
    },
    {
      "lineId" : "NWS Line A",
      "layerId" : 4,
      "lrsNetworkId" : 2,
      "lrsNetworkName" : "Pipelines",
      "user" : "bob",
      "versionName" : "bob.job_23",
      "versionGuid": "{DB13BAC4-08BB-4DCF-A93B-48BF105DC804}",
      "lockDate" : 1393888540000,
      "eventFeatureClassName": ""
    },
    {
      "lineId" : "NWS Line B",
      "layerId" : 5,
      "lrsNetworkId" : 2,
      "lrsNetworkName" : "Pipelines",
      "user" : "alice",
      "versionName" : "alice.job_24",
      "versionGuid": "{679599AE-16A2-4F8F-AC48-E278D6892016}",
      "lockDate" : 1393888542000,
      "eventFeatureClassName": "P_Anomaly"
    }
  ]
}