How to determine current edit session locking a version?

4552
3
02-18-2015 12:45 PM
Highlighted
New Contributor II

Is there a way to determine which session is locking a version, DEFAULT in particular?

I reviewed the How to find locks preventing a specific version from being deleted within SDE tables? posting, but in a recent situation where our DEFAULT version was locked, the select owner from sde.process_information where sde_id = 'xxxxx' query (from the other post) returned more than 1 owner/session.

We are at 10.2.1

Reply
0 Kudos
3 Replies
Highlighted
Regular Contributor III

Check in Geodatabase Administrator.

Right-click on the geodatabase connection> Administration> Administer geodatabase> Locks> in Lock Type..select "Version"

Highlighted
New Contributor II

Do you know what the query is that would return the same info (Object Name, Object Type, Lock Type, Lock Owner, Lock Mode and Date Acquired) outside of ArcCatalog (e.g. from SqlPlus)? 

The reason I ask is that there is a bug (BUG-000083139) that causes the dialog box to respond very slowly for geodatabases with a considerable number of versions (ours is over 30k), so if it's possible to do this from the command line it would make it a little easier to work with.

And in the situation I describe (our DEFAULT version locked), would the Lock Mode in the Geodatabase Administrator show as 'Exclusive' to pinpoint the locking session?  Oftentimes the Geodatabase Administrator will show multiple 'Shared' locks, which are not a problem.

Reply
0 Kudos
Highlighted
Occasional Contributor II

Any active connection to the DEFAULT version in your geodatabase will register locks in the SDE tables, even if these connections are merely viewing data, so it is plausible for there to be multiple "owners" of these locks (i.e. one for each distinct connection).

The recommendation fromAsrujit SenGupta‌ should certainly work to display the info you need.

If you are working purely from the SQL side, the following query might also help:

SELECT

  pri.owner,

  tr.table_name,

  tl.*

FROM sde.sde_versions v

JOIN sde.SDE_state_locks sl ON sl.state_id = v.state_id

JOIN sde.SDE_process_information pri ON pri.sde_id = sl.sde_id

JOIN sde.sde_table_locks tl ON tl.sde_id = pri.sde_id

JOIN sde.sde_table_registry tr ON tr.registration_id = tl.registration_id

WHERE v.name = 'DEFAULT'