Select to view content in your preferred language

Disconnect Users from Specific Dataset within Enterprise GDB using Python

5300
2
03-02-2015 06:02 PM
BenVan_Kesteren1
Deactivated User

Hi All,

I currently use the arcpy.disconnectUsers() tool in python to successfully disconnect all users prior to performing my weekly compress.

I am wondering if anyone knows how to disconnect people from a specific Dataset, rather than the entire SDE?

For example, I have a py script that needs exclusive lock on the below feature class, so i want to disconnect users from this specific spot.

Is it possible?

Thanks

2015-03-03_12-59-06_ArcCatalog - Database ConnectionsGISADMIN@SDE_Spatial@Smithy.sdeSDE_SPATIAL.GI.jpg

0 Kudos
2 Replies
BlakeTerhune
MVP Frequent Contributor

I haven't seen anything that will let you release specific locks like that. I think the best you can do is just disconenct the user from SDE. However, you should disconnect all users for a compress anyway.

If you have a different script that needs access to a particular table, you could use the Registration_ID from SDE.Table_Registry table to find any locks on it in the SDE.Table_Locks table. If there are locks listed for that table, you could take the SDE_ID of the lock(s) and use DisconnectUser() to kick just that person (or persons) with the locks.

You can get detailed connection information about a particular SDE_ID in the SDE.Process_Information table or with ListUsers(). You can query all these SDE tables with arcpy using ArcSDESQLExecute().

BenVan_Kesteren1
Deactivated User

Hi Blake,

Thanks for the info, I will look into the leads you have given me.

I do agree regarding the disconnection of all users for a compress, but this specific script I am writing is not for a compress, but to perform attribute updates of feature classes within a specific dataset, hence my rather odd request to only disconnect users from this dataset.

Thanks again for your contribution, cheers.

0 Kudos