Skip to main content
Question

remove sde locks, stop service for ags and portal


gisbradokla
Enthusiast
Forum|alt.badge.img+17

I have a scheduled workspace that needs to truncate an sde table. The table is shared as aservice in AGS and portal. I see a customtransformer to start/stop the arcgisserver.  

But if i'm not mistaken this would not remove any locks that are on the sde table.

do i need to put this into an automation in order to make all this happen? since i don't see any specific transformers to accomplish this. is it going to have to be through the rest api or python? does anyone have a workflow and or script to do this?

I assume i would need to...

  1. stop the AGS service (to keep someone from connecting while the rather lengthy trunc/load is happening)
  2. then remove the locks (I think i have only heard of doing this through the rest api).
  3. run the fme wkspc and truncate then load the new data.
  4. restart the service.

 

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+53
  • Celebrity
  • August 5, 2022

Hey, so stopping the service will remove any locks on SDE that the service had. If another user/service has a lock on the data, this will still remain.

To fully drop all locks from SDE you'd need to use ArcPy.

The rough steps would be:

  1. stop service(s)
  2. disable connections - https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/acceptconnections.htm
  3. disconnect users - https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/disconnectuser.htm
  4. perform the truncate
  5. enable connections
  6. start service(s)

gisbradokla
Enthusiast
Forum|alt.badge.img+17
  • Author
  • Enthusiast
  • August 5, 2022
hkingsbury wrote:

Hey, so stopping the service will remove any locks on SDE that the service had. If another user/service has a lock on the data, this will still remain.

To fully drop all locks from SDE you'd need to use ArcPy.

The rough steps would be:

  1. stop service(s)
  2. disable connections - https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/acceptconnections.htm
  3. disconnect users - https://pro.arcgis.com/en/pro-app/2.8/arcpy/functions/disconnectuser.htm
  4. perform the truncate
  5. enable connections
  6. start service(s)

hmm, Thank you! Now if i can just figure out how to implement that into a scheduled wksp


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings