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
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().
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.