Mulitple locks on Domain

229
4
a month ago
DerekBernard
Occasional Contributor

I want to update a domain but I need to remove the locks.  However, this domain has about twenty different features that can and will lock it.  Is there a way to remove the locks from all those features so I can update the domain or do I need to just go through an unlock all twenty and hope none pop back in. Looking for a good strategy here.

4 Replies
ZachBodenner
MVP Regular Contributor

Are the locks occurring because users are connected to the database? Because the features containing the domain are published to the web? If you're the only one connected then you (I think) shouldn't be getting locked.

I have users that connect to an enterprise geodatabase as well as many features published to web services. When I need to update a domain (which I schedule out) and someone is locking the domain because they're connected to the EGDB, then I manually disconnect the user. I also shut down the ArcGIS Server Service to free up the locks placed by that software.

DerekBernard
Occasional Contributor

Yes, it's because users are connected.  Normally I just drop the locks because it usually has little impact to the users if that feature isn't available for a minute or two (They just think it's internet issues.)  It seems overkill just to add a value and have it sorted into the other values (add works, but sorting needs the locks removed.)  Also, scheduling downtime would probably need to be after hours which is a partial issue because I don't work after hours and I'm not sure how to do that from an HR standpoint (government job).

0 Kudos
ZachBodenner
MVP Regular Contributor

I'm in government work too (don't know what line you're in but I'm local city government) and I just straight up told my users: we're going to be instituting some work-hours down time. Choose between a short time every week or a long time every month. Consensus came down on a short time once a week, so whenever I get requests for this kind of work I put it on a list and just try to get to work as early as possible every Wednesday. We don't have an expectation from our users of zero-downtime for anything other than our public safety stuff (which is a separate server), so this system has been working rather well.

EdMorris
Esri Contributor

Hi Zach

I'm not sure how you got on in the end regarding your issue but I suspect a way forward may be to script your workflow.

I would suggest:

1: Create a script and run as a scheduled task to run when nobody is actively using the Enterprise Geodatabase

2: Use the arcpy.DisconnectUser() to disconnect any users who still might be accessing datasets:

https://pro.arcgis.com/en/pro-app/3.1/arcpy/functions/disconnectuser.htm

3: Update your domain using arcpy by calling one of two geoprocessing tools, either:

- the Add Coded Value To Domain geoprocessing tool

https://pro.arcgis.com/en/pro-app/3.1/tool-reference/data-management/add-coded-value-to-domain.htm

or

- the Add Coded Value To Domain geoprocessing tool:

https://pro.arcgis.com/en/pro-app/3.1/tool-reference/data-management/add-coded-value-to-domain.htm

Hopefully you have a workaround if this doesn't appeal....

Many thanks ed